打包时出现此错误:
No resource found that matches the given name (at ‘networkSecurityConfig’ with value ‘@xml/network_security_config’).
Error: No resource found that matches the given name (at ‘networkSecurityConfig’ with value ‘@xml/network_security_config’).
在 res 下新增一个 xml 目录,然后创建一个名为:network_security_config.xml 文件(名字自定) ,内容如下,大概意思就是允许开启http请求
<?xml version="1.0" encoding="utf-8"?>然后在APP的AndroidManifest.xml文件下的application标签增加以下属性
<application
…
android:networkSecurityConfig="@xml/network_security_config"
…
/>