昨天我获得了 Android N 预览版的新升级。自从我升级后,我就无法再启动我的应用程序了。
java.io.IOException: Cleartext HTTP traffic to myserver.com not permitted
我尝试过设置usesCleartextTraffic
to true
在清单中或添加network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">myserver.com</domain>
</domain-config>
</network-security-config>
两者都不起作用。对那里发生的事情有什么想法吗?
当我尝试在清单中定义 networkSecurityConfig 时,出现编译错误
Error:(35) No resource identifier found for attribute 'networkSecurityConfig' in package 'android'
不太确定为什么。文件就在那里,一切看起来都很好。
Found Google 的 Android 问题跟踪器中的建议。他们建议将network_security_config
定义为meta-data
。但我仍然遇到同样的例外。
android:usesCleartextTraffic="true"
将此行放在清单文件的应用程序标记中
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)