Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not install the app on the device - react native on windows 10

Tags:

react-native

Everytime I try to launch a react native project I got this error

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

I reinstalled nodejs, python and jdk using choco as suggested on official docs. Every single packages is installed as well as sdk 23.0.1

screenshot

I can see my virtual device if I run adb devices USB debugging is activated and it's running android 6.

I setup ANDROID_HOME path in environment variables, I'm using same sdk path as you can see in the picture. I also setup another one for JAVA_HOME and Python.

My PATH looks like this:

PATH

I just don't understand what I'm supposed to do. I'm using a surface pro 4, Windows 10. I can run projects using expo. I literally tried everything, restart computer, start cmd using admin, create new virtual devices, uninstall everything and start from scratch, it just don't work.

like image 711
blacksun Avatar asked Jan 31 '18 05:01

blacksun


1 Answers

You have pointed out two issues; first, make sure you have an android emulator running. To do that, you run adb devices and you say you can see you device.

The other issue is with the environment. To make sure your environment is setup properly for android, go to the root of your react-native project. Open the android project using android studio.

All errors with your environment will show up, use the automatic fixes provided by android studio. Clean the project in android studio. Close studio and go back to command line, run react-native run-android

Everything should work now.

like image 76
Isaac Sekamatte Avatar answered Sep 24 '22 00:09

Isaac Sekamatte