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!
2
Answers
I tested that version of Android Studio on two more Macbook devices, and all of them had the same issue. Only the new release of Android Studio worked
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 emulatorCtrl+M
, it will open the debug menu, change the IP and port to your IP address, and port as 8081.