仅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
相关产品推荐
相关产品推荐

