Reputation: 23
When I run react-native
application on Android device it gives error on red screen:
unable to load scripts from bundle "index.android.bundle"
Upvotes: 2
Views: 1771
Reputation: 1414
Using npm version 4.3.0 react-native-cli version 2.01 react-native version 0.49.5
In project directory,
mkdir android/app/src/main/assets
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
The file name has changed from index.android.js to index.js
Upvotes: 1
Reputation: 1755
This following steps helped me resolve the problem in following steps.
If not than (in project directory) mkdir android/app/src/main/assets
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
react-native run-android
Upvotes: 2