2

I am trying to run my react project for my android phone . But when typing this command react-native run-android

This error appears:

FAILURE: Build failed with an exception.
What went wrong:
* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

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/getting-started.html

Any help please.

3
  • Have you referred to the links and other content in the error log? Commented Sep 2, 2018 at 13:11
  • Which operating system are you trying to run the project on ? Commented Sep 2, 2018 at 15:42
  • It may be a problem with permission of the android folder, if it is linux or mac system then give full permission to the android folder Commented Sep 2, 2018 at 17:19

1 Answer 1

1

It literally means what it says, you don't have an emulator running or a device configured in debug/development mode connected to your computer.

run the following (assuming you have the android tools setup correctly, look here for instructions on how to do this: https://developer.android.com/studio/command-line/adb)

adb devices

if you get the following:

List of devices attached

If there's nothing listed then you either need to start an emulator using Android Studio, command line or something like https://www.genymotion.com/.

if you're trying to connect to your Android device via USB then you need to check the version of Android you are using and enable development mode via USB in your device's settings.

here's some docs on how to enable your device for development: https://developer.android.com/studio/debug/dev-options

Once you have an emulator or device configured and attached you can run:

adb devices

If everything is working correctly you should see a list of device(s) available.

react-native run-android

Should now work as expected.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.