当我运行react-native run-android时,我遇到了这个错误。我试图将我的java版本降级到8,但仍然不起作用。
运行jetifier将库迁移到AndroidX的信息。您可以使用"--no-jetifier“标志禁用它。Jetifier找到960个要转发jetify的文件。使用8个工人...info JS服务器已在运行。正在安装应用程序的信息...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
* What went wrong:
Task 'installDebug' not found in project ':app'.
* Try:
Run gradlew tasks to get a list of available tasks. 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 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Task 'installDebug' not found in project ':app'.
* Try:
Run gradlew tasks to get a list of available tasks. 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 3s
at makeError (D:\freelance\SuperDaily\node_modules\execa\index.js:174:9)
at D:\freelance\SuperDaily\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async runOnAllDevices (D:\freelance\SuperDaily\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (D:\freelance\SuperDaily\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)发布于 2021-05-31 14:00:05
我在这个(“node_modules/execa/index.js”)文件中也遇到了类似的错误。我使用下面给出的两个命令解决了我的错误
npm uninstall -g react-native-cliyarn global add @react-native-community/cli如果我的解决方案不起作用,请检查其他解决方案here
发布于 2021-05-31 14:10:03
react-native run-android --variant Huaweidebug 使用上面的命令运行。它应该修复,但如果存在错误,请在android studio中打开项目
https://stackoverflow.com/questions/62125902
复制相似问题