安卓9.0系统出现 CLEARTEXT communication to XX not permitted by network security policy
由于2018年发布的Android P限制了非加密的流量请求导致出现 not permitted by network security policy
解决的办法有2种
1.把所有的http请求全部改为https请求
2.在res的xml目录(),然后创建一个名为:network_config.xml文件
在文件中设置cleartextTrafficPermitted为开启状态
<?xml version=”1.0” encoding=”utf-8”?>
并在AndroidManifest.xml中配置cleartextTrafficPermitted
————————————————
版权声明:本文为CSDN博主「逻鸡」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/w180600/article/details/85230778
还没有评论,来说两句吧...