反应本地应用程序正常工作,但APK和--variant = release在加载时反复崩溃

时间:2018-10-31 06:31:45

标签: android android-studio react-native apk bundler

运行logcat之后。我发现了以下错误异常:

AndroidRuntime: java.lang.RuntimeException: Unable to load script from assets 'index.android.bundle'. Make sure your bundle is packaged correctly or you're running a packager server.

是否创建apk /运行变体发行版会自动包含捆绑软件?如何重建和验证捆绑软件已包含在apk /变体版本中?

我尝试添加bundleAssetName: "index.android.bundle",

project.ext.react = [
    entryFile: "index.js",
    bundleAssetName: "index.android.bundle",
]

我仍然遇到相同的问题(反复崩溃)。我搜索“例外”并发现此错误:

java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@b60a260 does not exist

1 个答案:

答案 0 :(得分:0)

为了确保apk中包含捆绑软件,这是必需的

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

从此post.