I always get these errors while building my Cordova project and i tried updating everything in SDK manager and acceppting all licenses but i still get these error’s. how can I fix this?
ANDROID_SDK_ROOT=C:UsersAmirAppDataLocalAndroidSdk (recommended setting) ANDROID_HOME=C:UsersAmirAppDataLocalAndroidSdk (DEPRECATED) Using Android SDK: C:UsersAmirAppDataLocalAndroidSdk 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:UsersAmirAppDataLocalAndroidSdkemulator-2' (Expected 'C:UsersAmirAppDataLocalAndroidSdkemulator') Build-tool 31.0.0 is missing DX at C:UsersAmirAppDataLocalAndroidSdkbuild-tools31.0.0dx.bat Observed package id 'emulator' in inconsistent location 'C:UsersAmirAppDataLocalAndroidSdkemulator-2' (Expected 'C:UsersAmirAppDataLocalAndroidSdkemulator') File C:UsersAmir.androidrepositories.cfg could not be loaded. Observed package id 'emulator' in inconsistent location 'C:UsersAmirAppDataLocalAndroidSdkemulator-2' (Expected 'C:UsersAmirAppDataLocalAndroidSdkemulator') Build-tool 31.0.0 is missing DX at C:UsersAmirAppDataLocalAndroidSdkbuild-tools31.0.0dx.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-SoftwaresWeb devVue androidamir-weathersrc-cordovaplatformsandroidgradlew cdvBuildDebug -b L:Amir-SoftwaresWeb devVue androidamir-weathersrc-cordovaplatformsandroidbuild.gradle App • Command "cordova" failed with exit code: 1 App • Updated Cordova config.xml App • ⚠️ FAIL Cordova CLI has failed```
Advertisement
Answer
as the outpus sais, the Build Tools revision 31.0.0 is apparently corrupted. All you need to do is:
- Open Android Studio
- Go to Tools, SDK Manager
- On SDK Tools, click on Show Package details
- On Android SDK Build-Tools 31, uncheck the version 31.0.0 and check the 30.0.3
- Click on Apply, and it’ll install the version.