1

I am trying to build my Android app and I have been struggling with setting the version of build tools on Cordova, as within android studio the fix that worked for me was this Youtube Tutorial I figured if I could fix it on Android Studio I could fix it on Cordova build so I tried to replicate the fix on the video within my build.gradle, I've tried to modify my build.gradle projet.ext:

    project.ext {
      defaultBuildToolsVersion="30.0.3" //String
      defaultMinSdkVersion=22 //Integer - Minimum requirement is Android 5.1
      defaultTargetSdkVersion=29 //Integer - We ALWAYS target the latest by default
      defaultCompileSdkVersion=29 //Integer - We ALWAYS compile with the latest by default
    }

However it still uses version 31.0.0.

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 10s
Command failed with exit code 1: C:\Users\adam\OneDrive\Documents\Projects\Diabetes App\Bolus-Calculator\platforms\android\gradlew cdvBuildDebug -b C:\Users\adam\OneDrive\Documents\Projects\Diabetes App\Bolus-Calculator\platforms\android\build.gradle

Can anyone show me how to replicate the fix within Cordova.

Many Thanks, Adam

Adam Films
  • 11
  • 6
  • 3
    Does this answer your question? [Android Studio error "Installed Build Tools revision 31.0.0 is corrupted"](https://stackoverflow.com/questions/68387270/android-studio-error-installed-build-tools-revision-31-0-0-is-corrupted) – javdromero Jul 22 '21 at 18:55
  • @javdromero I have just tried the first answer to that post modified my build.grade. I am new to using gradle and I have set defaultBuildToolsVersion, defaultTargetSdkVersion, defaultCompileSdkVersion all to 30. however it seems to have ignored and still tried to build using 31. If I remove the default from the start of the variable the error changes to: ```compileSdkVersion is not specified. Please add it to build.gradle```. Thank you for this suggestion – Adam Films Jul 22 '21 at 19:20
  • Also attempted renaming d8 -> dx. – Adam Films Jul 22 '21 at 19:23
  • 1
    I would like to know how to set the build tools version in cordova. – Adam Films Jul 22 '21 at 19:30

0 Answers0