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

仅Android模拟器出现Apollo Network请求失败问题求助

仅Android模拟器中Apollo网络请求失败排查

仅Android模拟器中出现Apollo Network请求失败,iOS真机及iOS模拟器中请求可正常运行,请求对象为真实生产服务器而非本地服务器。

报错信息如下:

ApolloError: Network request failed
    at new ApolloError (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=myapp&modulesOnly=false&runModule=true:162987:26)
    at Object.error (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app= myapp&modulesOnly=false&runModule=true:140360:70)
    at notifySubscription (http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app= myapp&modulesOnly=false&runModule=true:158462:20)

已尝试的配置:

  • 在清单文件中设置android:usesCleartextTraffic="true"
  • 在android/app/src/main/res/xml/network_security_config.xml中将域名加入白名单:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">https://myserverdomain.com</domain>
        <domain includeSubdomains="true">127.0.0.1</domain>
        <domain includeSubdomains="true">10.0.0.1</domain>
        <domain includeSubdomains="true">localhost</domain>
    </domain-config>
</network-security-config>

请问还遗漏了什么配置?


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.31 17:50:33