【发布时间】:2016-07-31 02:06:45
【问题描述】:
我刚刚安装了 React Native 和 Android Studio。我在 ubuntu 14.04 LTS 上,我正在尝试运行
react-native run-android
但我有这样的错误
Starting JS server...
Running /home/marta/Android/Sdk/platform-tools/adb reverse tcp:8081 tcp:8081
error: no devices/emulators found
Could not run adb reverse: Command failed:/home/marta/Android/Sdk/platform-tools/adb reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && ./gradlew installDebug...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> failed to find Build Tools revision 24.0.1
* 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: 6.992 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
我也查了
android list sdk -a
我安装了
Installing Archives:
Preparing to install archives
Downloading Android SDK Platform-tools, revision 24.0.1
Installing Android SDK Platform-tools, revision 24.0.1
Stopping ADB server succeeded.
Installed Android SDK Platform-tools, revision 24.0.199%)
Stopping ADB server succeeded.
Starting ADB server succeeded.
Done. 1 package installed.
这就是我的 build.gradle 文件的样子
http://i.imgur.com/xWGnMTY.png
你知道出了什么问题吗?
很抱歉没有发布照片,但显然我需要 10 点声望。
【问题讨论】:
-
error: no devices/emulators found... 运行adb devices。有联系吗? -
那么下面...
Make sure you have an Android emulator running or a device connected and have set up your Android development environment: -
虽然...根据您的 build.gradle,您使用的是
23.0.1,因此该错误没有任何意义。 -
可能您已安装构建工具修订版 24.0.1,但在您的 gradle 中您将构建工具修订版声明为 23.0.1。这只是猜测,没有您提供更多信息。能否请您打开 Android SDK Manager 并检查您的计算机上安装了哪些组件?
标签: android android-studio react-native