Vivek
Vivek

Reputation: 56

Unable to load script from assets 'index.android.bundle',Make sure your bundle is packaged

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.

Upvotes: 1

Views: 5153

Answers (4)

MJ Montes
MJ Montes

Reputation: 3376

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

cd android

./gradlew clean

Upvotes: 0

Kosalram Ramakrishnan
Kosalram Ramakrishnan

Reputation: 818

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

Upvotes: 1

Hemant Sharma
Hemant Sharma

Reputation: 279

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.

Upvotes: 3

Kevin
Kevin

Reputation: 575

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.

Upvotes: 0

Related Questions