为此,OkHttp3 做了检查,所以如果使用了明文流量,默认情况下,在 Android P 版本 OkHttp3 就抛出异常: CLEARTEXT communication to " + host + " not permitted by network security policy
if(!Platform.get().isCleartextTrafficPermitted(host)){ thrownewRouteException(newUnknownServiceException( "CLEARTEXT communication to "+ host +" not permitted by network security policy")); }