更新后,它不再支持使用 -t构建构建apk文件: android -t apk,而是建议使用eas build -p -p预览,但最终它构建了aab而不是apk。我查看了新添加的eas.json文件,该文件包含:
{
"cli": {
"version": ">= 0.52.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {}
},
"submit": {
"production": {}
}
}我阅读了eas文档,它建议将我的eas.json更改为:
{
"cli": {
"version": ">= 0.52.0"
},
"build": {
"preview": {
"android": {
"buildType": "apk"
}
},
"preview2": {
"android": {
"gradleCommand": ":app:assembleRelease"
}
},
"preview3": {
"developmentClient": true
},
"production": {}
}
} 运行构建命令之后:eas -p -p-profile预览
它正确地将应用程序构建为apk文件,并在android上安装得很好,但在打开时,它会立即关闭自己。在试图重新打开它之后,关闭了它,现在提醒它,应用程序崩溃了。
我的eas.json文件中有错误吗?还是我遗漏了什么?
发布于 2022-05-11 21:34:47
将eas.json中的生产密钥更改为
"production": {
"android": {
"buildType": "apk"
}
}所以现在你的eas.json是这样
{
"cli": {
"version": ">= 0.52.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {
"android": {
"buildType": "apk"
}
}
},
"submit": {
"production": {}
}
}要构建到.apk文件中,可以使用生产概要文件进行构建。类似于这个eas build --profile production --platform android的命令
发布于 2022-05-17 10:24:25
以下是详细说明:https://docs.expo.dev/build/eas-json/
需要在项目目录中创建eas.json,如下所示:
{
"build": {
"preview": {
"android": {
"buildType": "apk"
}
},
"preview2": {
"android": {
"gradleCommand": ":app:assembleRelease"
}
},
"preview3": {
"developmentClient": true
},
"production": {}
},
"cli": {
"version": ">= 0.52.0"
}
}然后使用以下命令:
eas build -p android --profile preview你好,Shameel
发布于 2022-05-12 02:58:31
在将我的应用程序升级到EAS时,我也遇到了一些问题,原因是我使用了来自expo-constant的一个值,它返回了一个null,所以它会使我的应用程序崩溃。新的SDK将我需要的值移动到expo-device。
我的哨兵也造成了一个问题,它会造成即时崩溃时,该应用程序打开。试着暂时删除它,看看你的应用程序是否会打开。
https://stackoverflow.com/questions/72204856
复制相似问题