You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter应用AAB上传Google Play后HTTP请求失效问题求助

Flutter AAB包上传Google Play后HTTP请求失效问题(APK正常)

我需要在iOS和Android平台的Flutter应用中允许所有HTTP请求(默认禁用不安全的HTTP连接)。APK包在debug和release模式下运行正常,但将AAB包上传至Google Play后无法正常工作。我已执行以下配置操作:

  1. 创建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>
  1. 在AndroidManifest.xml的application标签中添加配置:
<application
  android:usesCleartextTraffic="true"
  android:networkSecurityConfig="@xml/network_security_config"
......
  >
  1. 在application标签中添加meta-data配置:
<application 
......>
.....
<meta-data android:name="io.flutter.network-policy"
 android:resource="@xml/network_security_config"/>
 </application>
  1. 添加网络权限:
<uses-permission android:name="android.permission.INTERNET"/>

内容的提问来源于stack exchange,提问作者Mohamad Eizeddin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 20:43:51