0

When I run react-native run-android I get the bellow Error:

BUILD FAILED
Total time: 19.668 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

But after running it for several times and having error, let say about five times, it works! this process wastes so much of my time, so any suggestion is appreciated.

Amin
  • 141
  • 1
  • 1
  • 5

3 Answers3

0

Install the app manually with adb in your emulator if not installed, then you could just use react-native start to start react native.

error404
  • 331
  • 1
  • 8
0

This problem occurred to me too.

If you don't have expo app installed on the emulator then download expo app and install it on your emulator, if you don't know how then see this post.

If you have it installed then clear the node cache as mentioned upwards and do npm start don't do npm start android, If don't work again then u reinstall all the packages but u must delete all the packages that are located on C:\Users\YOURUSERNAME\AppData\Roaming\npm and C:\Users\YOURUSERNAME\AppData\Roaming\npm-cache delete all those and then go here and create a new project from scratch, that worked for me.

And if you have expo software application on your computer don't use it ,it mess up your project with updates and so new problems come, just use the terminal.

Goodluck.

klendi
  • 718
  • 7
  • 14
0

What helped me was to occasionally open and build the project using android studio. It will download all the gradle updates and android versions... most of the time I start the emulator from Android studio and the npm start to start the packager.

tlagreca
  • 358
  • 1
  • 6
  • 20