0

I'm stack on one error in on build time with Cordova. I have already installed android build tools but ionic through error "No installed build tools found. Install the Android build tools version 30.0.3 or higher". I do not understand why this error show. Below mentioned error, please check and help me.

ANDROID_HOME=C:\Users\prade\AppData\Local\Android\Sdk (DEPRECATED) Using Android SDK: C:\Users\prade\AppData\Local\Android\Sdk\build-tools\32.0.0 Subproject Path: CordovaLib Subproject Path: app

FAILURE: Build failed with an exception.

  • Where: Script 'C:\ionic\demoApp\platforms\android\CordovaLib\cordova.gradle' line: 69

  • What went wrong: A problem occurred evaluating script.

No installed build tools found. Install the Android build tools version 30.0.3 or higher.

  • 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings BUILD FAILED in 1s Command failed with exit code 1: C:\ionic\demoApp\platforms\android\gradlew :app:bundleRelease -b C:\ionic\demoApp\platforms\android\build.gradle [ERROR] An error occurred while running subprocess cordova.

    cordova.cmd build android --release exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information. 

2 Answers2

2

The error produced by Cordova is misleading (there is an open issue here).

Cordova by default is looking for build tools version >= 30.0.3 but still within version 30. The purpose for this behaviour is so Cordova doesn't automatically pick up a build tools version that it is likely not compatible with.

Using <preference name="android-buildToolsVersion" value="32.0.0" /> should allow you to override this behaviour and Cordova will use the desired build tools version as requested.

However there are known incompatiblities with Build tools version 31, and I doubt build tools 32 will work either. I'd highly suggest installing build tools 30.0.3 as that's the version that is tested against the current version of cordova.

Norman Breau
  • 2,132
  • 16
  • 35
  • 1
    bro, you save lots of time for me. i wasted 3 hours stresful for this. all environment sett up correctly but still not detected, my sdk is ```32.0.0.```. this really unexpected behaviour to must set manually. thankyou – david valentino Feb 23 '22 at 09:59
0

Navigate to your android build tools directory

C:\foo\sdk\build-tools\32.0.0

and rename d8.bat to dx.bat

Now do the same for d8.jar in the /lib folder.

Credits go to 'user16475264' (https://stackoverflow.com/a/68430992/3365033)

DGK
  • 2,947
  • 5
  • 32
  • 47