5

I'm getting the following error when i run the cmd > react-native run-android Guide me to fix this issue.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

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

BUILD FAILED

Total time: 1 mins 27.72 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
Sivaraj-v
  • 371
  • 1
  • 3
  • 17

4 Answers4

11

It seems that there's no connected devices or the device could not be detected. Execute adb devices to see the list of connected devices. If no device appears make sure that your emulator is open, or your device is connected and usb debugging mode is enabled.

If that doesn't fix it, restart the adb server by running adb kill-server and then adb start-server (you may need to run it with sudo if you're using linux or mac)

But if adb devices shows unauthorized you just need to unlock your phone and give your computer access.

Atef
  • 1,294
  • 1
  • 14
  • 27
2

Above error is for device is connected or not

Please run following command and check device is connected or not

adb devices

Nisarg Thakkar
  • 1,497
  • 16
  • 25
1

Make sure you have turned on USB debugging.

k.saurabh
  • 11
  • 1
0

First of all you have to turn on developer mode in your physical device. For android it can be easily found on setting (search on youtube if you don't know how to turn developer mode on).

After that run adb devices

In MIUI 11 I found that after some time it's automatically disabled developer mode. So you have to re-enable it.

TripleM
  • 1,096
  • 7
  • 20