java.net.UnknownServiceException: CLEARTEXT communication to 192.168.0.1 not permitted by network

HTTP FAILED: java.net.UnknownServiceException: CLEARTEXT communication to 172.29.1.233 not permitted by network security policy
Q:高版本Android默认禁止Http请求,放开方式:
①在res/xml文件夹下创建network_security_config.xml文件,内容如下:



    

②在AndroidManifest.xmlapplication节点添加如下内容:

 android:networkSecurityConfig="@xml/network_security_config"

java.net.UnknownServiceException: CLEARTEXT communication to 192.168.0.1 not permitted by network_第1张图片 

你可能感兴趣的:(安卓)