任务':app:installDebug'的React Native BUILD FAILED执行失败

Shi*_*iva 2 react-native react-native-android

运行cmd> react-native run-android时出现以下错误指导我修复此问题。

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.

BUILD FAILED

Total time: 1 mins 27.72 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
Run Code Online (Sandbox Code Playgroud)

Ate*_*tef 6

似乎没有连接的设备,或者无法检测到该设备。执行adb devices以查看已连接设备的列表。如果没有设备出现,请确保模拟器已打开,或者设备已连接并且启用了USB调试模式。

如果仍不能解决问题,请通过运行adb kill-server然后重新启动adb服务器adb start-serversudo如果使用linux或mac ,则可能需要与之一起运行)

但是,如果adb devices显示未经授权,则只需解锁手机并授予计算机访问权限。