不知道为何,需要手动将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
本文介绍了一个在Android项目中遇到的打包问题解决方案,即通过复制network_security_config.xml文件到特定目录来确保应用正常打包。文中提供了该文件的创建方法,对于没有此文件的项目尤其重要。
2856

被折叠的 条评论
为什么被折叠?



