Created
February 4, 2018 03:39
-
-
Save hellotunmbi/dc37dde31933b95cf0f5e185cc69df6b to your computer and use it in GitHub Desktop.
React Native: Unable to load script from assets index.android.bundle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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