首页 > 解决方案 > 搜索结果 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

标签: react-native

解决方案


我也有这个错误:app:processDebugResources,它可能是由很多原因引起的,但是我的错误是通过清理gradle解决的,你可以使用这个命令cd android && gradlew clean在项目的根文件夹中运行它来清理它。

此外,请确保您的 android 设备在 ADB 中可用。运行命令adb devices以获取当前运行的设备列表。如果列表为空,那么您需要修复您的 android 模拟器或设备,它必须与 adb 连接。


推荐阅读