react-native - 搜索结果 Web 结果命令失败:gradlew.bat installDebug
问题描述
代码正在运行,但我收到此错误。该应用程序未安装到模拟器。谁能帮我解决这个问题?
PS D:\3rd Year\Mobile Application Development\Projec\ChatBot\ChatBot> react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1152 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...
> Task :app:processDebugResources FAILED
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
105 actionable tasks: 3 executed, 102 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Unable to delete directory 'D:\3rd Year\Mobile Application Development\Projec\ChatBot\ChatBot\android\app\build\generated\not_namespaced_r_class_sources\debug\r\com\facebook\drawee\backends' after 10 attempts
* 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 20s
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=8081enter code here
解决方案
我也有这个错误:app:processDebugResources,它可能是由很多原因引起的,但是我的错误是通过清理gradle解决的,你可以使用这个命令cd android && gradlew clean
在项目的根文件夹中运行它来清理它。
此外,请确保您的 android 设备在 ADB 中可用。运行命令adb devices
以获取当前运行的设备列表。如果列表为空,那么您需要修复您的 android 模拟器或设备,它必须与 adb 连接。
推荐阅读
- django - Django:忽略 3 级基类和 Meta 类?
- javascript - ReactJs - 如何将 ApolloProvider 包装在 StatsigProvider 中?
- sensors - 如何使用 MAX30102 以协调的编码方式获得 BpM 和 SpO2?
- airflow - 如何将 xcom 的上下文和参数都传递给 python_callable
- javascript - 无法使用 Dropbox SDK 创建共享链接
- mysql - 将 csv 导入 mysql 不起作用或返回错误
- regex - VSCode 键绑定片段:使用 TM_SELECTED_TEXT 从选定字符串中删除所有斜杠
- react-native - 对于 react-navigation v6,getStateForAction 未定义
- google-ads-api - 如何通过 API 获取 Google Ads Lead Form Extension 的潜在客户?
- callbackurl - 什么是 API 的回调 url,以及何时以及如何在 python 中使用它