0

First I'm a newbie in react-native. I start a React-native in Facebook official site react-native tutorial. When I follow the react-native android setup step by step, then I run this project When a show this message please Resolve this Error, and Suggest me. Please help me.

D:\Linux\IDE\All-Workspace\JavaScript-Workspace\React-Workshop\AwesomeProject>react-native run-android
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat install debug)...

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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
27 actionable tasks: 1 executed, 26 up-to-date
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.
Ng Sharma
  • 2,072
  • 8
  • 27
  • 49
  • 2
    "No connected devices!" means you need to open an Android Emulator (or attach a device via USB), before trying to build. The third line from the bottom is largely helpful. – Dan Sep 21 '18 at 10:51
  • Possible duplicate of [com.android.builder.testing.api.DeviceException: No connected devices](https://stackoverflow.com/questions/48039119/com-android-builder-testing-api-deviceexception-no-connected-devices) – Ishita Sinha Sep 21 '18 at 11:07
  • I now that it's Duplicate Question but it not Resolve @IshitaSinha – Ng Sharma Sep 21 '18 at 11:15
  • did you attach a device or start an emulator? – Ishita Sinha Sep 21 '18 at 11:19
  • When attach the device, when show this error.
    > Task :app:installDebug FAILED Skipping device 'NE1GAM4780122174' (NE1GAM4780122174): Device is OFFLINE.
    – Ng Sharma Sep 21 '18 at 11:22
  • Please Remove the duplicate mark. if You do not Solved this Problem @IshitaSinha – Ng Sharma Sep 21 '18 at 12:39
  • Have you tried opening an emulator then running "react-native run-android"? In terms of seeing your device as offline, this might help: https://stackoverflow.com/questions/14993855/android-adb-device-offline-cant-issue-commands – rabbit87 Sep 22 '18 at 13:10
  • Okay I check this Link @rabbit87 – Ng Sharma Sep 22 '18 at 13:11
  • @NgSharma device offline means the device does not have USB debugging enabled. Please research enough before posting a question: https://stackoverflow.com/help/how-to-ask – Ishita Sinha Sep 24 '18 at 04:25
  • @lshita Sinha https://github.com/facebook/react-native/issues/15901 – Ng Sharma Sep 24 '18 at 06:06
  • @IshitaSinha Offline Android Emulator is working fine in Android Studio When I run this command 'adb devices' does not show any offline Device. When I attach the online device, when show this error. Task :app:installDebug FAILED Skipping device 'NE1GAM4780132154' (NE1GAM4780132154): Device is OFFLINE. – Ng Sharma Sep 24 '18 at 06:16
  • Dude. https://stackoverflow.com/questions/11810537/android-adb-doesnt-see-device – Ishita Sinha Sep 24 '18 at 06:56
  • Bro. I'm already try this...? – Ng Sharma Sep 24 '18 at 06:58
  • And did you enable USB debugging on the device? If yes, try with a different device. – Ishita Sinha Sep 24 '18 at 07:01
  • Have you tried "cold boot now" option through android studio device manager, and then rerun react-native run-android? Sometimes the devices hang and need it :S – angelos_lex Oct 05 '18 at 20:48

1 Answers1

1

Emulator frozen in same state even after reboot etc..?

Follow Steps:

  • Open Android Studio
  • Open Configure
  • Open AVD Manager
  • There should be an emulator which is causing the issue - (if not create a new emulator an test build).
  • Go to down arrow in Actions and Select Stop
  • Same again in Actions but this time select Cold Boot Now

This works for me whenever ive had issues with an emulator.