Error building an Android package "Installed Build Tools revision 31.0.0 is corrupted."

231 Views Asked by At

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

0

There are 0 best solutions below