反应本机 errorTimeout 获取设备列表.在 ubuntu 上运行 hello world 时 [英] react native errorTimeout getting device list. When running hello world on ubuntu
问题描述
我打印 react-native run-android
并得到以下输出:
FAILURE:构建失败,出现异常.
出了什么问题:任务:app:installDebug"执行失败.
<块引用>com.android.builder.testing.api.DeviceException:获取设备列表超时.
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪.使用 --info 或 --debug 选项运行以获得更多日志输出.
构建失败
总时间:1 分 11.385 秒无法在设备,请阅读上面的错误以了解详细信息.确保你有一个正在运行的 Android 模拟器或已连接设备并已设置您的安卓开发环境:
我发现这个是因为我意识到我的 adb 服务器没有启动.根据这篇 SOF 文章(Adb 无法启动),我将目录更改为我的 {ANDROID_SDK_FOLDER}/tools
并运行 adb kill-server
然后 adb start-server
只收到错误 adb server version (32) does不匹配此客户端 (36)
.对此进行搜索使我找到了以下文章,从而找到了解决方案.希望它可以帮助其他人:)
参考:http://nmp90.com/2016/04/android-adb-server-version-32-doesnt-match-client-genymotion/
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?
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...
- In Genymotion, go to Settings > ADB (tab)
- Select radio option "Use custom Android SDK tools" and add the path to your Android SDK
- Restart Genymotion (may not totally be necessary, but I did and it worked)
- 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]
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/
这篇关于反应本机 errorTimeout 获取设备列表.在 ubuntu 上运行 hello world 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!