在构建我的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```发布于 2021-08-29 11:23:02
作为outpus,构建工具修订版31.0.0显然已经损坏。你要做的就是:
30.0.3
H 214G 215它应该是这样的:

发布于 2022-01-05 10:08:23
首先,删除所有相关的文件夹和文件。然后,重新安装所有
在根文件夹磁盘中:

在用户\Usuario\appData\漫游文件夹中

在Users\Usuario.android文件夹中

在Usuario\appData\Android文件夹中,删除其所有内容

在程序文件中,在卸载android之前删除文件夹(使用Control或Config->Apps)

删除"path“环境变量


最后,重新安装android工作室。
这个错误使我损失了4个小时,我做的最好的事情就是完全删除所有的东西。造成此错误的原因是,您已经注册了两个构建工具。
你可以使用。$> ns设置。建立一个新的环境
ns setuphttps://stackoverflow.com/questions/68931751
复制相似问题