不知道为何,需要手动将android\app\src\main\res\xml中的network_security_config.xml复制一份到android\res\xml中才可以打包完成。

若是没有network_security_config.xml文件,则需要进行新建:

 

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

转自 https://www.shad0whz.com/default/2019/11/network_security_config.html

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐