You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

提交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文件夹后重新构建

解决步骤

  1. 强制指定生产环境profile构建
    你的eas.json仅在production profile中配置了生成AAB,执行构建时必须明确指定该profile,否则会默认使用preview或development(这两个未配置buildType,默认生成APK):

    eas build -p android --profile production
    
  2. 验证EAS CLI版本
    确保CLI版本满足配置要求(>=5.9.1),执行以下命令检查并升级:

    eas --version
    # 若版本过低,执行升级
    npm install -g eas-cli@latest
    
  3. 检查项目配置文件
    确认app.json或app.config.js中没有强制指定APK的配置,比如:

    // 错误示例,需移除或修改
    "android": {
      "buildType": "apk"
    }
    

    若存在上述配置,改为"buildType": "app-bundle"或直接删除该字段,让eas.json的配置生效。

  4. 确认构建产物格式
    构建完成后,前往EAS控制台查看构建产物,确认生成的是.aab文件而非.apk。

  5. 指定profile执行提交
    提交时同样要指定生产环境profile,确保使用正确的AAB产物:

    eas submit -p android --profile production
    

内容的提问来源于stack exchange,提问作者Joedson Santos

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 21:41:18