我已经完成了与react-native doc Linux-> Android相同的环境设置过程。
当我运行“ react-native run-android”时,出现错误提示
任务:app:installDebug失败 失败:构建失败,并出现异常。
有人可以帮我解决这个问题吗?
这是错误。
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.
答案 0 :(得分:0)
com.android.builder.testing.api.DeviceException:没有连接的设备!
此错误明确表明未找到要运行的设备。确保模拟器正在运行,并且如果使用物理设备,请确保设备上的开发人员模式和 USB调试已打开。
更多信息,https://developer.android.com/training/basics/firstapp/running-app