21

I print react-native run-android And get the following output:

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:installDebug'.

    com.android.builder.testing.api.DeviceException: Timeout getting device list.

  • 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 11.385 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

I have genymotion emulator running. I have defined android home and path

export ANDROID_HOME=/home/jonstark/Documents/android/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

In sdk manager I have downloaded all required packages. What do I do?

user2950593
  • 9,233
  • 15
  • 67
  • 131

3 Answers3

29

The problem @Gaurang was solving was a problem with ADB. The reason that the build failed is because ADB times out querying for the available devices.

The following steps resolved this issue for me...

  1. In Genymotion, go to Settings > ADB (tab)
  2. Select radio option "Use custom Android SDK tools" and add the path to your Android SDK
  3. Restart Genymotion (may not totally be necessary, but I did and it worked)
  4. If the above steps don't work, try also rebooting your machine as commenters have stated this worked for them. [Added This on Aug 10th]

enter image description here

I found this because I realized that my adb server wasn't started. Following this SOF article (Adb won't start), I changed directory into my {ANDROID_SDK_FOLDER}/tools and ran adb kill-server then adb start-server only to receive the error adb server version (32) doesn't match this client (36). Searching this lead me to the following article and hence the resolution. Hope it helps someone else :)

Reference: http://nmp90.com/2016/04/android-adb-server-version-32-doesnt-match-client-genymotion/

Community
  • 1
  • 1
Chris Geirman
  • 9,474
  • 5
  • 37
  • 70
  • 1
    This worked perfectly. If restarting Geny doesn't work, just reboot. – vhs Aug 01 '16 at 18:40
  • If this doesn't work for you, try rebooting your Mac as @JoshH mentioned. I was banging my head until I read his comment and it worked as soon as I rebooted (just make sure to start an Android simulator in Genymotion before you attempt to run the `react-native run-android` command or that'll give you an error as well). – Lansana Camara Aug 10 '16 at 00:10
  • 1
    Thanks @Lansana, I'll update my answer to reflect this so it's not missed again. – Chris Geirman Aug 10 '16 at 17:57
3

First check which adb are you using.

$ which adb


If you get like this:

/home/wakematta/Android/Sdk/platform-tools/adb

Follow this steps


If you get like this:

/usr/bin/adb

You have a confilict of ADB's. You need to run this command to remove the unnecessary adb:

$ sudo apt-get autoremove android-tools-adb android-tools-fastboot

Community
  • 1
  • 1
Mohamed Ziata
  • 1,186
  • 1
  • 11
  • 21
0
  1. Download this arch. : https://dl-ssl.google.com/android/repository/platform-tools_r23.0.1-linux.zip
  2. Go to your Android SDK folder
  3. Remove old /platform-tools
  4. Insert downloaded from link above
  5. Hope this help you.

REference

make sure your adb version is 1.0.32

Community
  • 1
  • 1
  • 1
    How does this fix the error? I'm not clear. The reference you provided above was related to an adb version error. I just installed 23.0.1 build tools through the Android SDK Manager, which I believe is the same thing you're manually doing above, right? Shouldn't that have also solved it? – Chris Geirman Jun 20 '16 at 21:26