I am new to react-native and I want to build and run a simple application. It was working fine but when I close the emulator and try to run it again, the android emulator is stuck on the loading screen.
The build is successful. I run react-native start on one terminal and then react-native run-android in another terminal. This was the output of the terminal when I run-android.
BUILD SUCCESSFUL in 2s
26 actionable tasks: 1 executed, 25 up-to-date
info Running adb -s emulator-5554 reverse tcp:8081 tcp:8081
info Starting the app on emulator-5554 (adb -s emulator-5554 shell am start -n com.myapp/com.myapp.MainActivity)...
Starting: Intent { cmp=com.myapp/.MainActivity }
My emulator is Nexus 5X, API version 28, memory 1536 MB.
react-native-cli version: 2.0.1
react-native version: 0.59.3
I'm using ubuntu 18.04 and the RAM capacity is 8gb.
I am sure there is no error in the code, because it worked fine previously.
I tried deleting the node modules and cleaning the cache and then npm install. But still couldn't get it running
So it works for me when i restart watchman server, clear the cache, delete the node modules and do a npm install.
echo 256 | sudo tee -a /proc/sys/fs/inotify/max_user_instances
echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events
echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
watchman shutdown-server
npm cache clear
rm -rf node_modules/
npm install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With