android - 模拟器不工作:任务“: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.
解决方案
即使在重新启动等之后,模拟器也冻结在相同的状态......?
遵循步骤:
- 打开安卓工作室
- 打开配置
- 打开 AVD 管理器
- 应该有一个导致问题的模拟器 - (如果没有创建一个新的模拟器一个测试版本)。
- 转到操作中的向下箭头并选择停止
- 在 Actions 中再次相同,但这次选择Cold Boot Now
每当我遇到模拟器问题时,这对我有用。
推荐阅读
- flutter - Flutter in app purchase 检查购买是否成功
- django - 如何使用 django 创建数据库,然后将该数据库连接到我的 django 应用程序?
- wordpress - Wordpress 搜索优化:限制搜索结果(不是 post_per_page)
- python - 我需要有关 Selenium 和 chrome 网络驱动程序的帮助。我的 CommandPrompt 中弹出一个错误,我不知道如何解决它
- reactjs - 创建 React 项目的问题
- python-asyncio - 为什么我们需要将 [] 添加到可迭代数组并将 * 添加到 asyncio.gather?
- python - Swift HTTP 会话未发送实际请求
- python - 如果只给出一个参数,如何忽略变量声明中的第二个参数
- python - 如何自动解析 JSON 并获取变量中的所有键值对?
- javascript - 选项卡时选择2表单控件不聚焦