Skip to content

Instantly share code, notes, and snippets.

@hellotunmbi
Created February 4, 2018 03:39
Show Gist options
  • Save hellotunmbi/dc37dde31933b95cf0f5e185cc69df6b to your computer and use it in GitHub Desktop.
Save hellotunmbi/dc37dde31933b95cf0f5e185cc69df6b to your computer and use it in GitHub Desktop.
React Native: Unable to load script from assets index.android.bundle
1. (in project directory) mkdir android/app/src/main/assets
2. 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
3. adb reverse tcp:8081 tcp:8081
4. react-native run-android
You can automate the above steps by placing them in scripts part of package.json like this:
"android-linux": "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 && react-native run-android"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment