React-native: 0.72.5 "react-native-code-push": "8.0.0" code-push-cli: 2.6.5 客户端已通过微软[官方文档](https://github.com/microsoft/react-native-code-push/blob/master/docs/api-android.md)进行配置。 strings.xml配置为本地的服务: ``` <resources> <string moduleConfig="true" name="CodePushDeploymentKey">8vmuHikmKmbOqBFA2xk2Lilmu1QZ4ksvOXqog</string> <string moduleConfig="true" name="CodePushServerURL">http://192.168.31.14:3000</string> </resources> ``` 安卓模拟器启动app后codepush提示 Network request failed。 请问安卓端该如何配置?
Activity
billxie1988 commentedon Feb 14, 2025
确保你的本地开发服务器可以通过 http://192.168.31.14:3000 访问。你可以尝试在安卓模拟器中打开浏览器访问这个地址,确认服务是否能够正常响应。
如果不能访问,尝试使用 10.0.2.2 来替换本地 IP 地址。在安卓模拟器中,10.0.2.2 是指向主机(开发机器)localhost 的地址。即:
http://10.0.2.2:3000