0
votes

I have run a React Native project on Windows by using react-native run-android command. I got the following error in the emulator:

Unable to load script from assets 'index.android.bundle' .Make sure your bundle is packaged correctly or you are running a package server.

enter image description here

I tried these links but not work with me.

Unable to load script from assets index.android.bundle on windows.

2
I was facing the same issue and it solves my problem: queception.com/question.php?question=10Stack Overflow
please check this link, i hope can help you stackoverflow.com/questions/55441230/…RohMad Rock

2 Answers

0
votes

I had the same error in the same context, and it was simply because the app launched before the development server finished to bundle up the files. Make sure you wait untill the node development server displays:

Loading dependency graph, done

and hit reload on the app.

0
votes

Go to your project folder android/app/src/main/assets

Delete index.android.bundle and index.android.bundle.meta

If assets directory not there create new one.

Go to root project > cd android

./gradlew/clean

In root folder run following command if there was index.js file

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

If there are two files index.android.js and index.ios.js then run

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

Above two are single line commands.