You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "rolinger (via GitHub)" <gi...@apache.org> on 2025/06/06 12:50:50 UTC

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

rolinger opened a new issue, #1801:
URL: https://github.com/apache/cordova-android/issues/1801

   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 output instructed higher a 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 JKD 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).
   
   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
   ...
   
   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 `android@13.0.0` - 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Versioning issues with cordova-android 12, 13 and 14. [cordova-android]

Posted by "Dan890 (via GitHub)" <gi...@apache.org>.
Dan890 commented on issue #1801:
URL: https://github.com/apache/cordova-android/issues/1801#issuecomment-3022823325

   Hi, I ran into the exact same issue and wanted to share what I found — and how I solved it.
   
   Cordova Android uses a JSON config file — cdv-gradle-config.json — that defines the Gradle version like so:
   "GRADLE_VERSION": "8.9"
   
   This version is then used inside build.gradle to create the Gradle wrapper with:
   task wrapper(type: Wrapper) {
       gradleVersion = cordovaConfig.GRADLE_VERSION
   }
   
   However, the wrapper file (gradle-wrapper.properties) is not always regenerated automatically. So if you previously added cordova-android@14 (which might’ve pulled Gradle 8.9), and then downgraded to @13, the config file might still refer to a newer Gradle version — even though the wrapper on disk is older (e.g., 8.4 or 7.6.5).
   
   My Solution
   platforms/android/gradle/wrapper/gradle-wrapper.properties
   ⚠️ If it doesn't exist (this happened to me):
   You need to manually create the folder and the file:
   Create directory:
   platforms/android/gradle/wrapper/
   Create file: gradle-wrapper.properties
   
   With this content (adjust version as needed):
   distributionBase=GRADLE_USER_HOME
   distributionPath=wrapper/dists
   distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
   zipStoreBase=GRADLE_USER_HOME
   zipStorePath=wrapper/dists
   
   Once I did this, the build worked fine again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Versioning issues with cordova-android 12, 13 and 14. [cordova-android]

Posted by "rolinger (via GitHub)" <gi...@apache.org>.
rolinger commented on issue #1801:
URL: https://github.com/apache/cordova-android/issues/1801#issuecomment-2949452644

   In the `cdv-gradle-config.json` file I hard set `"GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION":"4.4.2", and compiled my app again. It still failed, but back in that json file the plugin version was set back to 4.3.15.
   
   Doing a deeper search in my project/platforms/android folder I only found two references to the com.google.gms:google-services version:
   
   In platforms\android\app\build.gradle: String gradlePluginGoogleServicesClassPath = "com.google.gms:google-services:${cordovaConfig.GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION}"
   In platforms\android\cordova-plugin-firebasex\myapp-build.gradle: classpath 'com.google.gms:google-services:4.3.10'
   So I am not certain where 4.3.15 keeps getting reset or where to physically change the version to 4.4.2.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Versioning issues with cordova-android 12, 13 and 14. [cordova-android]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1801:
URL: https://github.com/apache/cordova-android/issues/1801#issuecomment-3667575135

   Closing this as the discussion got stale, and I think the documentation links noted https://github.com/apache/cordova-android/issues/1801#issuecomment-3047354928 covers the subjects well.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Versioning issues with cordova-android 12, 13 and 14. [cordova-android]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek closed issue #1801: Versioning issues with cordova-android 12, 13 and 14.
URL: https://github.com/apache/cordova-android/issues/1801


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Versioning issues with cordova-android 12, 13 and 14. [cordova-android]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1801:
URL: https://github.com/apache/cordova-android/issues/1801#issuecomment-3047354928

   > 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
   
   Gradle as a product itself supports a wide range of JDKs. It's the AGP (Android Gradle Plugin) that is often picky and requires a specific JDK. The safest bet is match the version (or use the actual version) that is shipped with Android Studio. So even if Gradle as of Gradle 8.14 supports JDK 24, the Android Gradle Plugin used to build android binaries might not.
   
   We do have recommended versions documented at https://cordova.apache.org/docs/en/dev/guide/platforms/android/index.html.
   
   Most of the settings found `cdv-gradle-config.json` is configurable via preferences (see https://cordova.apache.org/docs/en/dev/config_ref/index.html). If you're manipulating the json file manually, it will get reset on the next platform prepare.
   
   > Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0
   
   This message we see on every major gradle/AGP release and historically it's always AGP using deprecated gradle features and not your application or cordova framework. It can be safely ignored.
   
   > In the cdv-gradle-config.json file I hard set `"GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION":"4.4.2", and compiled my app again. It still failed, but back in that json file the plugin version was set back to 4.3.15.
   
   It needs to be set in the `config.xml` using the `GradlePluginGoogleServicesVersion` preference. 4.4.2 is the default for cordova-android@14 though.
   
   e.g.: `<preference name="GradlePluginGoogleServicesVersion" value="4.4.2" />`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org