当前位置: 移动技术网 > 移动技术>移动开发>Android > Android 9.0+软件某些功能突然暴毙:cleartext not permitted

Android 9.0+软件某些功能突然暴毙:cleartext not permitted

2020年07月17日  | 移动技术网移动技术  | 我要评论

线上项目某功能突然暴毙,测试后发现Android 5 没问题 Android 9+功能报错:cleartext not permitted

然后去百度后才发现Android9.0对未加密的流量不在信任,添加了新的限制。

解决方案:
在Android 的mainfest.xml中的application添加一句配置
配置的意思是:指示应用程序是否打算使用明文网络流量,例如明文HTTP

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        ...
        android:usesCleartextTraffic="true"
        ...>
        ...
    </application>
</manifest>

参考文档

https://www.jianshu.com/p/6b9ea90eb3c1

https://www.cnblogs.com/a155-/p/12749340.html

本文地址:https://blog.csdn.net/ywh22122/article/details/107375486

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网