Flutter应用AAB上传Google Play后HTTP请求失效问题求助
Flutter AAB包上传Google Play后HTTP请求失效问题(APK正常)
我需要在iOS和Android平台的Flutter应用中允许所有HTTP请求(默认禁用不安全的HTTP连接)。APK包在debug和release模式下运行正常,但将AAB包上传至Google Play后无法正常工作。我已执行以下配置操作:
- 创建
network_security_config.xml文件,内容如下:
<?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> </network-security-config>
- 在
AndroidManifest.xml的application标签中添加配置:
<application android:usesCleartextTraffic="true" android:networkSecurityConfig="@xml/network_security_config" ...... >
- 在application标签中添加meta-data配置:
<application ......> ..... <meta-data android:name="io.flutter.network-policy" android:resource="@xml/network_security_config"/> </application>
- 添加网络权限:
<uses-permission android:name="android.permission.INTERNET"/>
内容的提问来源于stack exchange,提问作者Mohamad Eizeddin
相关产品推荐
相关产品推荐

