淘先锋技术网

首页 1 2 3 4 5 6 7

执行命令
cordova build android
错误提示No resource found that matches the given name (at ‘networkSecurityConfig’ with value '@xml/network_s
解决方法
项目根目录\platforms\android\res\xml
添加文件network_security_config.xml(名字自定义)

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true" />
</network-security-config>

找到文件项目根目录\platforms\android\AndroidManifest.xml
添加

 <application 
 ...
android:networkSecurityConfig="@xml/network_security_config" 
...>

    </application>

...>

    </application>