0
votes

I am running $react-native run-android. it is working properly, also, I am able to see the changes on android emulator. I have created 3 components and also tested it on android device.

But now, suddenly, it is asking me unable to load script from assets 'index.android.bundle' Also, I have reverted the changes and started but still I am seeing this error.

After serching on internet, I performed, 1. npm start 2. react-native start 3. adb kill-server and adb start-server but all in vein.

Last, I found and performed below commands, $ 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

I am able to resolve above error with above commands, but now, when I am changing App.js file, it is not getting reflected on emulator. please help.

My steps performed: http://sachin4java.blogspot.in/2017/12/unable-to-load-scripts-from-assets.html

1
Did you try resetting the bundler cache? react-native start --reset-cacheKraylog
for $ react-native start --reset-cache, I am getting below error, 'ERROR Metro Bundler can't listen on port 8081'.Also tried below commands but No LUCK. \n sachin@sachin-E470:~/react-native/aaaa$ lsof -i -P|grep 8081 node 5026 sachin 23u IPv6 2053427 0t0 TCP *:8081 (LISTEN) sachin@sachin-E470:~/react-native/aaaa$ sudo kill -9 5026 [sudo] password for sachin: sachin@sachin-E470:~/react-native/aaaa$ react-native start --reset-cache sachin@sachin-E470:~/react-native/aaaa$ react-native run-androidSachin Rane
You installed a --dev false app on your emulator. Try uninstalling it before running react-native run-androidKraylog
where to change this '--dev false' setting in react-native appSachin Rane
I meant, the app that is installed on your emulator now is not in dev mode - look at the bundle command you typed. Uninstall the app - adb uninstall your.package.name and then run-android again.Kraylog

1 Answers

0
votes

I have tried many things as found on internet, but no one worked.
I removed installed node, NPM and nodejs I installed it again with : http://sachin4java.blogspot.in/2017/12/react-native-setup-in-ubuntu-16.html

Then I installed in new version in Android studio AVD image named 'Nexus_5X_API_26(AVD)'. Now, I am able to see the code changes reflecting and red error screen gone.