java.net.UnknownServiceException: CLEARTEXT communication to XXX not permitted by network security policy

------------恢复内容开始------------

https://developer.android.com/training/articles/security-config

https://www.jianshu.com/p/d7adc60d4913

https://blog.csdn.net/yechaoa/article/details/89646416

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application       
        android:networkSecurityConfig="@xml/network_security_config"
        ... >
        ...
    </application>
</manifest>

 

 res/xml/network_security_config.xml:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <base-config cleartextTrafficPermitted="true" />
</network-security-config>

 

 

------------恢复内容结束------------

https://developer.android.com/training/articles/security-config

https://www.jianshu.com/p/d7adc60d4913

https://blog.csdn.net/yechaoa/article/details/89646416

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application       
        android:networkSecurityConfig="@xml/network_security_config"
        ... >
        ...
    </application>
</manifest>

 

 

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <base-config cleartextTrafficPermitted="true" />
</network-security-config>

 

 
posted @ 2019-11-25 00:01  dmwc  阅读(1230)  评论(0编辑  收藏  举报