【发布时间】:2019-04-20 20:00:25
【问题描述】:
我已经完成了与 react-native doc Linux -> Android 相同的环境设置过程..
当我运行“react-native run-android”时,出现错误提示
任务 :app:installDebug 失败 FAILURE:构建失败并出现异常。
谁能帮我解决这个问题?
这是错误..
azran@Azran:~/Desktop/AwesomeProject2$ react-native run-android
info JS server already running.
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...
> Task :app:installDebug FAILED
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 8s
26 actionable tasks: 25 executed, 1 up-to-date
error 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.html
error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.
【问题讨论】:
-
com.android.builder.testing.api.DeviceException: No connected devices!:检查您是否启动并运行了模拟器。如果您使用的是设备,请确保设备中启用了开发者模式,并且 PC 可以使用它进行调试。
标签: javascript android react-native android-gradle-plugin