Search code examples
androidcordovahybrid-mobile-app

Cordova Build Failed: Deprecated Gradle?


I am trying to create an android hybrid app using cordova. I do not know much about it, I just create my web-based files under the www folder and run the cordova commands and I expect it to work. However, I've got this message this time and I do not know how to fix it. Could you help me, please?

D:\Users\Manolo\Documents\AppsAndroid\MusicTimeline>cordova build android
    Checking Java JDK and Android SDK versions
    ANDROID_HOME=C:\Users\Manolo\AppData\Local\Android\sdk (recommended setting)
    ANDROID_SDK_ROOT=undefined (DEPRECATED)
    Using Android SDK: C:\Users\Manolo\AppData\Local\Android\sdk
    Subproject Path: CordovaLib
    Subproject Path: app

FAILURE: Build failed with an exception.

* Where:
Script 'D:\Users\Manolo\Documents\AppsAndroid\MusicTimeline\platforms\android\CordovaLib\cordova.gradle' line: 75

* What went wrong:
A problem occurred evaluating script.
> No usable Android build tools found. Highest 33.x installed version is 29.0.2; Recommended version is 33.0.2.

* 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.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 669ms
Command failed with exit code 1: D:\Users\Manolo\Documents\AppsAndroid\MusicTimeline\platforms\android\gradlew -b D:\Users\Manolo\Documents\AppsAndroid\MusicTimeline\platforms\android\build.gradle cdvBuildDebug

Solution

  • No usable Android build tools found. Highest 33.x installed version is 29.0.2
    

    You need to open Android Studio and install build-tools v33+. Right now you have 29.0.2 installed and it requires 33.