Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
This repository was archived by the owner on May 20, 2025. It is now read-only.

Unable to load script from assets 'index.android.bundle'. #1474

@LzxHahaha

Description

@LzxHahaha

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Steps to Reproduce

  1. Config code push just like the document said
  2. Generate and install a release apk
  3. Try to run and then will crash

Expected Behavior

No crash

Actual Behavior

adb logcat:

12-17 14:18:30.851 12660 12676 D ReactNative: Initializing React Xplat Bridge.
12-17 14:18:30.851 12660 12676 D ReactNative: Initializing React Xplat Bridge before initializeBridge
12-17 14:18:30.861 12660 12676 D ReactNative: Initializing React Xplat Bridge after initializeBridge
12-17 14:18:30.861 12660 12676 D ReactNative: CatalystInstanceImpl.runJSBundle()
12-17 14:18:30.871 12660 12676 E AndroidRuntime: FATAL EXCEPTION: Thread-19940
12-17 14:18:30.871 12660 12676 E AndroidRuntime: Process: com.xxxapp, PID: 12660
12-17 14:18:30.871 12660 12676 E 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.
12-17 14:18:30.871 12660 12676 E AndroidRuntime: 	at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
12-17 14:18:30.871 12660 12676 E AndroidRuntime: 	at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:216)
12-17 14:18:30.871 12660 12676 E AndroidRuntime: 	at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:32)
12-17 14:18:30.871 12660 12676 E AndroidRuntime: 	at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:243)
12-17 14:18:30.871 12660 12676 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1114)
12-17 14:18:30.871 12660 12676 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.access$900(ReactInstanceManager.java:116)
12-17 14:18:30.871 12660 12676 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:913)
12-17 14:18:30.871 12660 12676 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:818)

I try to unarchiver the apk, there is nothing in asset directory, so I tried to manually generate a bundle with

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

and generate a new apk, this one work just fine.

It any way to automatic generate index.android.bundle ?

Environment

  • react-native-code-push version: 5.4.2
  • react-native version: 0.57.4
  • iOS/Android/Windows version: Android 6.0.1
  • Does this reproduce on a debug build or release build? Release only
  • Does this reproduce on a simulator, or only on a physical device? Physical device

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions