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

Expo(React Native) Android构建崩溃,模拟器与iOS运行正常求助

安卓APK构建后崩溃:无法加载JS脚本(iOS端无异常)

4年前用过Expo,之后转用纯React Native规避异常问题,现在又碰到故障:项目在模拟器上运行完全正常,但通过eas build生成的.apk安装包安装后持续崩溃,看起来像是没关联到JS代码;本地执行./gradlew assembleDebug生成的安装包也出现同样问题,不过iOS端一切正常。

环境信息

  • expo-cli 6.1.0
  • Expo SDK 46

EAS构建配置

"development": {
  "channel": "development",
  "android": {
    "autoIncrement": "versionCode",
    "buildType": "apk"
  },
  "ios": {
    "resourceClass": "m1-medium"
  }
}

Logcat报错日志

java.lang.RuntimeException: Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.

已尝试的解决方案(均无效)

  • 更新Expo相关依赖
  • 将Gradle版本从7.0.4升级至7.1.2(参考部分社区线程提及此方案有效)
  • 调整多种eas.json配置项

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.30 07:24:56