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

React Native Expo Android生产构建失败,寻求可行解决步骤

解决EAS Build Android生产版本构建失败的具体步骤

一、修复Gradle依赖同步问题

  • 清理本地Gradle缓存,执行命令:
    ./gradlew cleanBuildCache
    
  • 检查android/build.gradle文件中的仓库配置,确保包含Google和Maven Central仓库:
    repositories {
        google()
        mavenCentral()
    }
    
  • 确认eas.json里production配置的Gradle版本与项目兼容,避免版本不匹配:
    "production": {
      "android": {
        "gradleVersion": "7.5"
      }
    }
    

二、修复签名证书验证问题

  • 核对eas.json中production profile的签名证书路径和别名配置,确保路径正确:
    "production": {
      "android": {
        "buildType": "app-bundle",
        "keystore": {
          "path": "./release-key.keystore",
          "alias": "your-key-alias"
        }
      }
    }
    
  • 本地验证证书密码有效性,执行命令并输入密码,能正常输出证书信息则密码正确:
    keytool -list -v -keystore ./release-key.keystore
    
  • 若使用EAS托管签名,重新关联凭证确保配置正确:
    eas credentials -p android
    

三、通用排查与修复步骤

  • 更新EAS CLI至最新版本:
    npm install -g eas-cli
    
  • 检查项目依赖版本,确保expo、react-native等核心依赖与当前EAS CLI版本兼容,参考官方兼容说明调整。
  • 清理远程构建缓存后重新触发构建:
    eas build -p android --profile production --clear-cache
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.04 16:50:04