今天出现同事反馈他的小米8手机安装apk,不能联网.
但是用另一个同事的小米8却可以.对比发现一台是android 8.0版本,一个是android 9 版本,报错如下:
01-24 15:55:09.006 25755 26012 D testConnect===: http://dev.isignet.cn:8080
01-24 15:55:09.006 25755 26012 W System.err: java.io.IOException: Cleartext HTTP traffic to dev.isignet.cn not permitted
01-24 15:55:09.006 25755 26012 W System.err: at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
01-24 15:55:09.007 25755 26012 W System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
01-24 15:55:09.007 25755 26012 W System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
01-24 15:55:09.007 25755 26012 W System.err: at cn.org.bjca.signet.helper.utils.C.a(Unknown Source:35)
01-24 15:55:09.007 25755 26012 W System.err: at cn.org.bjca.signet.b.t.a(Unknown Source:26)
01-24 15:55:09.007 25755 26012 W System.err: at cn.org.bjca.signet.b.t.doInBackground(Unknown Source:0)
解决方案参考如下博客