美文网首页
Andriod not permitted by network

Andriod not permitted by network

作者: 迷失在你de流年 | 来源:发表于2020-07-24 15:13 被阅读0次

导致上面问题的原因是:Andriod 9 系统更新,组织Http 不安全请求,解决办法:
解决方法:

image

如果你的应用加了信鸽推送的 Andriod P 兼容方案,那么你只需要在下面添加:
<base-config cleartextTrafficPermitted ="true" />
2.清单文件添加:

image

加上下面这个就行,位置看图,
android:networkSecurityConfig="@xml/xg_network_security_config"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:networkSecurityConfig">

如果你的tools:replace 原本已经存在,直接添加下面这样 ,用“,”分割,后面添加就好
tools:replace="android:theme,android:allowBackup,android:name,android:icon,android:networkSecurityConfig">

3.添加这个
<uses-library android:name="org.apache.http.legacy" android:required="false"/>

4.如何你的编译不通过,试试这样:
编译APK时使用compileSdkVersion和targetSdkVersion都使用28

相关文章

网友评论

      本文标题:Andriod not permitted by network

      本文链接:https://www.haomeiwen.com/subject/qqgjlktx.html