在Android模拟器运行最新EAS构建时遭遇Artifacts错误
解决EAS Build:Run Android最新构建报错问题
问题详情
执行命令eas build:run -p android --latest时触发错误:
Artifacts for the latest build have expired and are no longer available, or this is not a simulator/emulator build.
Error: build:run command failed.
旧版本构建可正常运行,但所有新构建均出现此问题;已尝试重新构建、迁移项目至新文件夹重新构建,且expo start可正常启动项目,但新构建的该问题仍未解决。
可行解决方案
确认构建类型适配模拟器
eas build:run仅支持针对Android模拟器构建的产物,真机构建的APK/AAB无法用该命令运行。需确保新构建使用模拟器专属配置:- 打开项目根目录的
eas.json,添加或修改如下构建profile:{ "build": { "simulator": { "android": { "emulator": true } } } } - 重新执行构建命令:
eas build -p android --profile simulator - 构建完成后再运行
eas build:run -p android --latest
- 打开项目根目录的
手动指定构建ID运行
若--latest参数识别异常,直接用具体构建ID运行:- 执行
eas build:list -p android获取所有Android构建记录,找到最新成功构建的ID(格式类似eas-xxxxxx) - 运行命令:
eas build:run -p android --id [你的构建ID]
- 执行
清除EAS本地缓存
本地缓存可能干扰构建产物识别,执行以下命令清除:eas build:clear-cache清除后重新构建并尝试运行。
更新EAS CLI到最新版本
旧版CLI可能存在兼容性bug,更新命令:npm install -g eas-cli(使用yarn则执行
yarn global add eas-cli)
内容的提问来源于stack exchange,提问作者John
相关产品推荐
相关产品推荐

