Unable to load scripts from assets index.android.bundle on real device.


Go to your project directory and check if this folder assets exists in project directory, if not then create the new folder assets.

android/app/src/main/assets

Run the command ./gradlew clean from the android folder.

cd android
.\gradlew clean

Note :In some operating system ./gradlew clean is used instead of .\gradlew clean

Finally, navigate back to the root directory and check.

1.If there is only one file i.e. index.js then run following 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

  2.If there are two files i.e index.android.js and index.ios.js then run this 

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

Now run the command react-native run-android

Renish

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top