2

When I run react-native application on Android device it gives error on red screen:

unable to load scripts from bundle "index.android.bundle"

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291

2 Answers2

2

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

Bhavan Patel
  • 1,755
  • 1
  • 16
  • 30
  • 1
    I am following this tutorial https://facebook.github.io/react-native/docs/getting-started.html . One thing I am not able o understand is that if `react-native init project_name` is creating a project and `react-native run-android` building my project and running on my connected machine then why I need to create a project using android studio ? Even why i do need android studio? – Sunil Garg Oct 01 '17 at 10:22
1

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

Darshan Pania
  • 1,374
  • 13
  • 20