1

I have made sure that bundler and emulator are running.

If I use this commend

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 

It might work but refresh won't happen when I press rr in emulator. I have also tried reversal of abd adb reverse tcp:8081 tcp:8081. Nothing works for me.

click here to see the error screen.

Kirankumar Dafda
  • 2,354
  • 5
  • 29
  • 56
Vivek
  • 56
  • 1
  • 4

4 Answers4

3

To resolve Unable to load script from assets index.android.bundle - React Native follow below process :

You have to create dir assets manually in your android project or make Directory by Terminal/CMD enter mkdir android/app/src/main/assets

Go at the created Directory if that is successfully created then

run step 3 Command:

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

you have your missed files in the folder now you can Run your React Native project npm run android.

Hemant Sharma
  • 259
  • 5
  • 14
1

Sometimes you have to clear the cache to load your assets properly. Use the command react-native start --reset-cache and re-run react-native run-android

Hemant Sharma
  • 259
  • 5
  • 14
  • delete your android and ios folders from your project directory and create again using the command **react-native eject** followed by linking your assets using a command **react-native link** – Kosalram Ramakrishnan Jun 27 '18 at 16:22
  • see this article it will solve your issue https://medium.com/@adityasingh_32512/solved-unable-to-load-script-from-assets-index-android-bundle-bdc5e3a3d5ff – saurabh dixit Aug 08 '19 at 10:28
0

I had this issue after having had it work for the past couple days. I realized that I had manually configured a proxy. As soon as I turned that off, it worked.

Kevin
  • 465
  • 6
  • 12
0

For me, Gradle clean fixed it when I was having an issue on Android

cd android

./gradlew clean
MJ Montes
  • 3,234
  • 1
  • 19
  • 21