无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在科尔多瓦有问题

Posted

技术标签:

【中文标题】无法确定任务 \':app:compileDebugJavaWithJavac\' 的依赖关系。在科尔多瓦有问题【英文标题】:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. having issue's in Cordova无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在科尔多瓦有问题 【发布时间】:2021-10-26 02:45:38 【问题描述】:

我在构建我的 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```

【问题讨论】:

【参考方案1】:

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

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

它应该看起来像这样:

【讨论】:

【参考方案2】:

首先删除所有文件夹和文件。 重新安装所有东西

在根文件夹磁盘中:

在文件夹 Users\Usuario\appData\Roaming

在文件夹 Users\Usuario\.android

在文件夹 Users\Usuario\appData\Android 中,删除所有文件夹

在控制面板或配置->应用程序中卸载软件android studio之前的程序文件中删除

删除路径或环境系统

然后重新安装 android studio。 这个错误让我损失了 4 个小时,而我做的最好的事情就是完全删除所有内容。这个错误是因为你注册了两个构建工具,你可以使用。 $> ns 设置。建立一个新的环境

ns setup

【讨论】:

以上是关于无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在科尔多瓦有问题的主要内容,如果未能解决你的问题,请参考以下文章

无法确定任务 ':app:mergeDebugAssets' 的依赖关系

颤振错误无法确定任务':app:compileDebugJavaWithJavac'的依赖关系

无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系。在电容android

Flutter Notification OneSignal - 无法确定任务':app:compileDebugJavaWithJavac'的依赖关系

无法确定任务 ':launcher_assist:compileProfileAidl' 的依赖关系

Flutter Build Error:无法确定任务':app:compileDebugJavaWithJavac的依赖关系