Expo(React Native)Android 构建崩溃,在模拟器和 iOS 上运行正常

问题描述 投票:0回答:0

之前一直在 Expo 工作,大约 4 年前,然后切换到纯 RN 以避免奇怪的问题,我们又来了。

在模拟器上运行良好,但使用

eas build
构建的 .apk 不断崩溃,看起来没有 js 链接到它们。在本地运行
./gradlew assembleDebug
后结果相同。需要帮忙。 iOS 没有问题。

expo-cli:6.1.0 SDK 46

EAS 构建配置:

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

该 apk 的 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 配置变体。

react-native expo
© www.soinside.com 2019 - 2024. All rights reserved.