cordova-android icon indicating copy to clipboard operation
cordova-android copied to clipboard

Versioning issues with cordova-android 12, 13 and 14.

Open rolinger opened this issue 4 months ago • 1 comments

Between Cordova-CLI v12 and the Cordova-Android v12, v13 and now v14 I think there needs to be better documentation on version requirements and compatibility. Hoping someone here can help straighten this out for me and then maybe it would serve others well if we also updated the READMEs to reflect the compatibility requirements for each.

In short, I have upgraded:

   Cordova-cli from v11.1 to v12
   cordova-android from v10.1.2 to v13
   local gradle 6.9.4 to 7.6.5
   jdk 11.0.26 (then later to jdk 17 when gradle 8.7 output instructed the higher JDK)
   nodejs from v14.16 to v22.16.0

Cordova-android v12 upgraded gradle to v7.6.5 while v13 makes no mention of a gradle upgrade. My JDK version is v11.0.26 - yet after installing cordova-android v13 I am getting Java errors saying I need JDK 17. So I upgrade to JKD 17 and now my gradle errors are showing references to using gradle v8.7 while also giving me messages Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.. All the while I have gradle 7.6.5 physically install on my windows machine (which apparently its not using at all).

And according to gradle documentation this is implying we need JDK 22 to run with Gradle 8.7 (even though an earlier error output stated it needed to be JDK 17): https://docs.gradle.org/current/userguide/compatibility.html

I guess things have changed a bit because my build.gradle file no longer has direct references to the specific packages, those are now found in the cdv-gradle-config.json file, which is:

{    "MIN_SDK_VERSION":24,
     "SDK_VERSION":34,
      "COMPILE_SDK_VERSION":34,
"GRADLE_VERSION":"8.7",
      "MIN_BUILD_TOOLS_VERSION":"34.0.0",
      "AGP_VERSION":"8.3.0",
      "KOTLIN_VERSION":"1.9.24",
      "ANDROIDX_APP_COMPAT_VERSION":"1.6.1",
      "ANDROIDX_WEBKIT_VERSION":"1.6.0",
      "ANDROIDX_CORE_SPLASHSCREEN_VERSION":"1.0.0",
"GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION":"4.3.15",
      "IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED":false,
      "IS_GRADLE_PLUGIN_KOTLIN_ENABLED":false,
      "PACKAGE_NAMESPACE":"com.myapp",
      "JAVA_SOURCE_COMPATIBILITY":8,
      "JAVA_TARGET_COMPATIBILITY":8,
      "KOTLIN_JVM_TARGET":null}

So, its pinning my gradle version to 8.7 while also pinning the gradle_plugin_google_services_version:4.3.15 and I think this where my incompatibility is coming from because I am getting the following build error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mapDebugSourceSetPaths'.
> Error while evaluating property 'extraGeneratedResDir' of task ':app:mapDebugSourceSetPaths'.
   > Failed to calculate the value of task ':app:mapDebugSourceSetPaths' property 'extraGeneratedResDir'.
      > Querying the mapped value of provider(java.util.Set) before task ':app:processDebugGoogleServices' has completed is not supported

I then pinned GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION: 4.4.2 - and still get the same above compile error.

But what I don't understand is if v12 uses gradle 7.6.5, v13 makes no gradle upgrade references, and v14 upgrades to v8.3, then where did v8.7 come from? And more importantly, what are the required versions and what do I edit or update to get everything back to the required versions.

On a side note, at one point I did the cordova platform add android and it grabbed v14.0.1 - not realizing that v14 was the latest version. So I removed it and then targeted [email protected] - so I am wondering if gradle 8.7 came from android@14 even though v14 notes say gradle was upgraded to 8.3. Frankly, I was surprised cordova-android@14 would even run on cordova-cli v12 but no one seems to be complaining about it.

rolinger avatar Jun 06 '25 12:06 rolinger