Cordova - Android - Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0

Viewed 764

Making an android project with cordova, when I try to making a build, it failed with this issue:

execution failed for task ':app:compileDebugJavaWithJavac'

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

These are my versions:

Cordova: 10.0.0
Android Platform: 10.1.2 
Gradle: 7.1.1

I am absolutely sure that Gradle is installed when I install the Android platform (and it is out of my control) and that everything was working fine until 1 month ago ... and I have not changed anything

How I can fix this issue??? Have I to update Gradle? How? Have I to update the project? How?

it's very strange ... and frustrating

2 Answers

Updating gradle solves the problem.

There are different ways to update the gradle, as explained in their official website: https://gradle.org/install/

Assuming that you are a windows user:

Downloading binary files of gradle and extracting the folder to the directory "c:/gradle" is enough.

  • Download binary files of gradle for the next version

  • Update path of gradle in PATH variable in your computer enter image description here

  • You should define another variable as follows: enter image description here

  • Variable name should be the same and its value should be the same with the one you use. While creating your cordova environment, this url is being used.

  • Save and restart your IDE's or CLI windows

  • test it out like ´gradle -v´ and you should see the active version of gradle in your system.

  • Be prepared to the new problems in your cordova environment because you have a upgraded gradle now

To fix the issue, I've reverted to cordova-android version 9.1.0. I've no idea, as of now, why cordova-android version 10 points to gradle, which as of now isn't possible to download...

Related