提交Android应用至Google Play时遇‘APKs are not allowed’错误求助
解决Google Play提交报错“APKs are not allowed for this application”并强制生成AAB格式
问题场景
执行eas build -p android提交应用到Google Play时,出现以下错误:
[logs] Google Api Error: Invalid request - APKs are not allowed for this application. - Retrying... [logs] Google Api Error: Invalid request - APKs are not allowed for this application. - Retrying... [logs] Google Api Error: Invalid request - APKs are not allowed for this application. - Retrying... [logs] Google Api Error: Invalid request - APKs are not allowed for this application. - Retrying... [logs] Google Api Error: Invalid request - APKs are not allowed for this application. - Retrying... [logs] [!] Google Api Error: Invalid request - APKs are not allowed for this application. [logs] Fastlane supply failed [logs] Failed to submit the app to the store [logs] End phase: SUBMIT_TO_PLAY_STORE
当前eas.json配置
已清理配置,仅保留生产环境设置:
{ "cli": { "version": ">= 5.9.1", "appVersionSource": "remote" }, "build": { "development": {}, "preview": {}, "production": { "android": { "buildType": "app-bundle" } } } }
已尝试操作
- 修改eas.json配置
- 清理缓存
- 删除android文件夹后重新构建
解决步骤
强制指定生产环境profile构建
你的eas.json仅在productionprofile中配置了生成AAB,执行构建时必须明确指定该profile,否则会默认使用preview或development(这两个未配置buildType,默认生成APK):eas build -p android --profile production验证EAS CLI版本
确保CLI版本满足配置要求(>=5.9.1),执行以下命令检查并升级:eas --version # 若版本过低,执行升级 npm install -g eas-cli@latest检查项目配置文件
确认app.json或app.config.js中没有强制指定APK的配置,比如:// 错误示例,需移除或修改 "android": { "buildType": "apk" }若存在上述配置,改为
"buildType": "app-bundle"或直接删除该字段,让eas.json的配置生效。确认构建产物格式
构建完成后,前往EAS控制台查看构建产物,确认生成的是.aab文件而非.apk。指定profile执行提交
提交时同样要指定生产环境profile,确保使用正确的AAB产物:eas submit -p android --profile production
内容的提问来源于stack exchange,提问作者Joedson Santos
相关产品推荐
相关产品推荐

