首页 > 解决方案 > 我刚刚使用 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:构建失败并出现异常。

10 秒内构建失败

错误 无法安装应用程序。确保您已设置 Android 开发环境:https ://reactnative.dev/docs/environment-setup 。使用 --verbose 标志运行 CLI 以获取更多详细信息。错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE:构建失败并出现异常。

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)

标签: react-native

解决方案


推荐阅读