首页 > 解决方案 > 模拟器不工作:任务“:app:installDebug”执行失败

问题描述

首先,我是 react-native 的新手。我在 Facebook 官方网站 react-native 教程中启动了一个 React-native。当我一步一步按照 react-native android 设置,然后我运行这个项目时,当显示此消息时,请解决此错误,并建议我。请帮我。

D:\Linux\IDE\All-Workspace\JavaScript-Workspace\React-Workshop\AwesomeProject>react-native run-android
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat install debug)...

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 6s
27 actionable tasks: 1 executed, 26 up-to-date
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.

标签: androidreact-native

解决方案


即使在重新启动等之后,模拟器也冻结在相同的状态......?

遵循步骤:

  • 打开安卓工作室
  • 打开配置
  • 打开 AVD 管理器
  • 应该有一个导致问题的模拟器 - (如果没有创建一个新的模拟器一个测试版本)
  • 转到操作中的向下箭头并选择停止
  • 在 Actions 中再次相同,但这次选择Cold Boot Now

每当我遇到模拟器问题时,这对我有用。


推荐阅读