错误:CLEARTEXT communication to www.baidu.com not permitted by network security policy

场景:我在使用OKHTTP3的Get异步请求http://www.baidu.com报错:

CLEARTEXT communication to www.baidu.com not permitted by network security policy

解决方案:

一:确保有网络权限

    

二:在application节点添加:android:usesCleartextTraffic="true"

 

    ………………………………

  

 

你可能感兴趣的:(Bug填坑笔记)