我正在为我的应用程序构建一个 apk,该应用程序是使用 expo 由 React Native 构建的
我在终端中使用 expo build:android
命令,之后我收到了一个选择提示:
? Would you like to upload a keystore or have us generate one for you?
If you don't know what this means, let us handle it! :)
所以我选择世博会来处理它,我得到了以下步骤
Publishing to channel 'default'...
Building iOS bundle
Building Android bundle
Analyzing assets
Uploading assets
Uploading \assets\alert.mp3
Uploading \assets\images\splash.png
Uploading \assets\images\icon.png
然后我得到了以下错误
read ECONNRESET
Set EXPO_DEBUG=true in your env to view the stack trace.
我也将expo-cli更新到了最新版本! 这是我的 app.json 如果有帮助的话
{
"expo": {
"name": "app name",
"slug": "app-name",
"platforms": [
"android"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"android": {
"package": "com.el3ameed.appname",
"versionCode": 1,
"adaptiveIcon": {
"foregroundImage": "./assets/images/icon.png",
"backgroundColor": "#171717"
}
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"bundleIdentifier": "com.el3ameed.appname",
"buildNumber": "1.0.0"
},
"description": ""
}
}
最佳答案
我假设您使用的是 Windows,因为我遇到了完全相同的问题。 因此,首先验证您是否已遵循此处给出的说明: https://docs.expo.io/versions/latest/distribution/building-standalone-apps/ 特别是关于安装 Ubuntu 和启用 WSL(按顺序)。
即使按照说明进行操作,我仍然收到此错误,因此对我有用的是禁用我的 Windows 防火墙。之后它就像一个魅力。
作为最后的手段,请尝试使用 VPN,因为这对我也有效。
关于android - 使用 expo build 读取 ECONNRESET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61020840/