gpt4 book ai didi

java - 无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在 Cordova 有问题

转载 作者:行者123 更新时间:2023-12-04 23:46:23 25 4
gpt4 key购买 nike

在构建我的 Cordova 项目时,我总是遇到这些错误,我尝试更新 SDK 管理器中的所有内容并接受所有许可证,但我仍然遇到这些错误。我怎样才能解决这个问题?

ANDROID_SDK_ROOT=C:\Users\Amir\AppData\Local\Android\Sdk (recommended setting)
ANDROID_HOME=C:\Users\Amir\AppData\Local\Android\Sdk (DEPRECATED)
Using Android SDK: C:\Users\Amir\AppData\Local\Android\Sdk
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Observed package id 'emulator' in inconsistent location 'C:\Users\Amir\AppData\Local\Android\Sdk\emulator-2' (Expected 'C:\Users\Amir\AppData\Local\Android\Sdk\emulator')
Build-tool 31.0.0 is missing DX at C:\Users\Amir\AppData\Local\Android\Sdk\build-tools\31.0.0\dx.bat
Observed package id 'emulator' in inconsistent location 'C:\Users\Amir\AppData\Local\Android\Sdk\emulator-2' (Expected 'C:\Users\Amir\AppData\Local\Android\Sdk\emulator')
File C:\Users\Amir\.android\repositories.cfg could not be loaded.
Observed package id 'emulator' in inconsistent location 'C:\Users\Amir\AppData\Local\Android\Sdk\emulator-2' (Expected 'C:\Users\Amir\AppData\Local\Android\Sdk\emulator')
Build-tool 31.0.0 is missing DX at C:\Users\Amir\AppData\Local\Android\Sdk\build-tools\31.0.0\dx.bat

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.

* 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 16s
Command failed with exit code 1: L:\Amir-Softwares\Web dev\Vue android\amir-weather\src-cordova\platforms\android\gradlew cdvBuildDebug -b L:\Amir-Softwares\Web dev\Vue android\amir-weather\src-cordova\platforms\android\build.gradle

App • Command "cordova" failed with exit code: 1
App • Updated Cordova config.xml

App • ⚠️ FAIL Cordova CLI has failed```

最佳答案

正如输出所说,构建工具修订版 31.0.0 显然已损坏。您需要做的就是:

  • 打开Android Studio
  • 转到工具,SDK 管理器
  • 在 SDK 工具上,单击显示包详细信息
  • 在 Android SDK Build-Tools 31 上,取消选中版本 31.0.0 并检查 30.0.3
  • 单击应用,它将安装该版本。

  • 它应该看起来像这样:
    Android Studio Screenshot

    关于java - 无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在 Cordova 有问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68931751/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com