react-native - 我刚刚使用 choco 安装了 react native,每次我在 cmd 上运行“npx react-native run-android”时都会收到这个错误
问题描述
此构建中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容。使用“--warning-mode all”显示各个弃用警告。请参阅https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE:构建失败并出现异常。
出了什么问题:在项目“:app”中找不到任务“installDebug”。
尝试:运行 gradlew 任务以获取可用任务列表。使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
在https://help.gradle.org获得更多帮助
10 秒内构建失败
错误 无法安装应用程序。确保您已设置 Android 开发环境:https ://reactnative.dev/docs/environment-setup 。使用 --verbose 标志运行 CLI 以获取更多详细信息。错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE:构建失败并出现异常。
- 出了什么问题:在项目“:app”中找不到任务“installDebug”。
- 尝试:运行 gradlew 任务以获取可用任务列表。使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
- 在https://help.gradle.org获得更多帮助
10 秒内构建失败
at makeError (C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\execa\index.js:174:9)
at C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)
解决方案
推荐阅读
- ssh - Terraform/GCP:未将 ssh 密钥添加到元数据中
- xamarin.android - 在从 App Center 导出的 Application Insights 中查看 Android 活动之间的转换
- c# - 使用 NewtonSoft 反序列化 JSON
- c# - 为什么数据绑定在 UserControl 上不起作用?
- linux - 如何解决此无法在 Linux 中运行的 Codeigniter 3 中查看登录页面的问题
- magento - Magento 1 仪表板聊天在升级到 1.9.4.1 后不起作用
- unit-testing - 在作为道具传递的函数上调用 Jest spyOn
- c# - HTTP 错误 502.5 - 尝试运行我的项目时进程失败
- regex - 如何以编程方式在 shell 脚本中提取 Python 版本?
- node.js - ng build 在 Docker 中返回致命的内存不足异常