2

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!

glushkina1
  • 164
  • 2
  • 15

2 Answers2

0

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

glushkina1
  • 164
  • 2
  • 15
-1

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.

Appy Mango
  • 1,298
  • 5
  • 16
  • 1
    cmd + M works, but there's no input or something in the debug menu, where I could change IP or port. The debug menu has only 'reload' button – glushkina1 Aug 13 '22 at 17:42
  • If Ctrl+M for Windows, or Cmd+M for Mac, doesn't open up the debug menu, try long press inside the screen, or run this on terminal `adb shell input keyevent 82` – Appy Mango Aug 14 '22 at 04:20
  • @glushkina1, did you try the above things to see if it solved your issue? – Appy Mango Aug 17 '22 at 04:30
  • hi, I have checked your solution on 13th of Aug. Debug menu has not got any input, where I could change IP or port. The page has only 'reload' button – glushkina1 Aug 19 '22 at 13:30
  • @ glushkina1, can you share the screenshot of the debug menu? – Appy Mango Aug 25 '22 at 20:21