-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android-targetSdkVersion 34 not working: Google Play Console reads 33, Cordova reads 34 #1729
Comments
Firstly, thanks for the detailed report. It helps quickly rule out A LOT of potential causes. cordova-android@13 by default targets API 34. But given that even after explicitly using the preference the build is still producing an API 33 target leads me to believe that there is a plugin or something overriding.
This is because SDK stuff is no longer set in AndroidManifest.xml directly. It's configured in gradle build scripts instead. The gradle build will merge in the configurations (which back in the day were manually set in AndroidManifest.xml), hence why you see it in the intermediates merged manifest's build artefact. If you're able to open the project in Android Studio, look at your AndroidManifest and use the Unfortunately the merged manifest while does link to manifest sources, including gradle files, it doesn't really point to you where the exact source is, so some digging will still be required. Cordova projects will have a config that looks like this in the app's build.gradle:
And the cordovaConfig values will be sourced from So I would:
I'm pretty confident that Cordova itself is behaving correctly, based on my own personal usages of Cordova. So I'd be pretty surprise if the issue is within the Cordova framework itself... This isn't an issue I've yet to see so that's why I'm pretty suspicious of a misbehaving plugin setting the target SDK, potentially overriding the application (since plugins becomes part of the application). Let me know if this helps or what you find. |
I've got it: i had included a gradle file myself (it was not a plugin!) which enforces sdk 33...Thanks for your quick reply! I've found my mistake: Not a long time ago I've included a file named
I've included that in my project within
SOLUTION: I just need to remove that file (both the ressource file and the Background of why I included that file in the pastJust for the record: I have included that file according to https://cordova.apache.org/docs/en/12.x/guide/platforms/android/#configuring-gradle when trying to fix an issue I had with a plugin
So I've tried fixing that issue in the past by creating that The actual fix to the compile time exception
So that's why I can safely remove my custom (not needed anymore: my responses to your hints)before finding the solution to this issue, I've provided some answers to your hints, so I'll just leave them here:
I've never worked with Android Studio (except for downloading the SDK), because I don't have an Android project but just work with cordova. I just opened the folder of all my Cordova files within Android Studio, but don't know where to find the AndroidManifest. I've checked https://stackoverflow.com/questions/4191762/how-to-view-androidmanifest-xml-from-apk-file which describes how to get the Manifest from bundled apks. I have the apk files too of course, but the android sdk
see full maybe this section is interesting from the
and maybe this is interesting too:
looks fine
At first I'll check all files named
|
Bug Report
Problem
What is expected to happen?
<preference name="android-targetSdkVersion" value="34" />
as target SDK 34 (Android 14)What does actually happen?
Google Play Console recognizes my app which includes
<preference name="android-targetSdkVersion" value="34" />
within the config.xml as target SDK 33 instead of 34. I've build version 18.26.0 today, see full config.xml and build log below.I already saw the same problem in my older release 18.25.4 from a week ago, too, which already included the same config.xml: image - so it is not a thing which just goes away after waiting a few days.
The problem I have is that I need to use SDK 34 starting 31. August 2024 to publish any app updates, see https://support.google.com/googleplay/android-developer/answer/11926878
Information
minSdkVersion
is not set too low?cordova platform remove android
before doingcordova platform add android@13.0.0
in my build script. Full build script see belowCommand or Code
Environment, Platform, Device
Version information
cordova platform add android@13.0.0
Checklist
Hints
platforms\android\app\build\outputs\logs\manifest-merger-debug-report.txt
I can see this:platforms\android\CordovaLib\build\outputs\logs\manifest-merger-debug-report.txt
I see something similar: manifest-merger-blame-debug-report.txtplatforms\android\app\src\main\AndroidManifest.xml
I cannot find anytargetSdkVersion
, see AndroidManifext.xml.txtplatforms\android\app\build\intermediates\merged_manifest\debug\processDebugMainManifest\AndroidManifest.xml
it looks like something was overriding or "injecting" another targetSdkVersion, and therefore I get a 33 instead of 34 here (see processDebugMainManifest_AndroidManifest.xml.txt):The text was updated successfully, but these errors were encountered: