Android Emulator with data crashes on launch Task :app:installDebug FAILED

Viewed 128

I created initial project (followed all the steps) by

npx react-native init AwesomeProject

when I run android emulator by:

npx react-native start
npx react-native run-android

I'm getting this error

> Task :app:installDebug FAILED

As I can see, there's no metro connection

When I wipe data or reinstall the emulator, it works fine for the first time, but when I load the app for the second time, I get this error again

Any ideas how to fix? Many thanks!

1 Answers

On the second time,

just run npx react-native start, and open the installed app from the emulator. If you see an error connecting to the metro, shake the emulator Ctrl+M, it will open the debug menu, change the IP and port to your IP address, and port as 8081.

Related