android - 尝试在真实设备上运行 react-native 但 installDebug 发生错误
问题描述
我正在尝试在我的 android 手机上运行 react native,但发生了这个错误。我使用了 react-native-cli。我还没有更改 react-native 提供的代码。请帮助。提前致谢
错误在这里=>
info 运行 jetifier 将库迁移到 AndroidX。您可以使用“--no-jetifier”标志禁用它。Jetifier 找到 967 个文件来转发-jetify。使用 8 名工人...
此版本中使用了已弃用的 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获得更多帮助
3 秒内构建失败
错误 无法安装应用程序。确保您已设置 Android 开发环境:https ://reactnative.dev/docs/getting-started.html#android-development-environment 。使用 --verbose 标志运行 CLI 以获取更多详细信息。错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE:构建失败并出现异常。
出了什么问题:在项目“:app”中找不到任务“installDebug”。
尝试:运行 gradlew 任务以获取可用任务列表。使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
在https://help.gradle.org获得更多帮助
3 秒内构建失败
at makeError (C:\Users\Buntu\Documents\projects\Contactapp\node_modules\execa\index.js:174:9)
at C:\Users\Buntu\Documents\projects\Contactapp\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\Buntu\Documents\projects\Contactapp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\Buntu\Documents\projects\Contactapp\node_modules\@react-native-community\cli\build\index.js:186:9)
C:\Users\Buntu\Documents\projects\Contactapp>
解决方案
推荐阅读
- ocr - tesseract 无法检测简单的二字图像中的字符
- node.js - 如何调试 Node.js 服务器?调试器跳过我的断点!(使用 VSCode)
- php - 如果消息包含使用 ajax、php 和 jquery 的超链接,则阻止表单提交
- matlab - 随机矩阵 2
- angular - github页面没有选择Angular应用程序?
- r - ROC曲线比较R中的逻辑回归和神经网络预测
- typescript - 如何在 TypeScript 的泛型函数中使用有界类型?
- class - 系统中类互连的逻辑方式
- tensorflow - 如何将 l2 归一化应用于 keras 中的图层?
- arduino - 在'{'令牌arduino led之前预期的不合格ID