Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react native errorTimeout getting device list. When running hello world on ubuntu

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?

like image 691
user2950593 Avatar asked Jan 09 '16 10:01

user2950593


2 Answers

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/

like image 64
Chris Geirman Avatar answered Oct 23 '22 17:10

Chris Geirman


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

like image 31
Mohamed Ziata Avatar answered Oct 23 '22 18:10

Mohamed Ziata