3

After uploading my APK in Google Play it shows in APK details :

API levels : 14-17

and publicly showing "4.0 and up" in play store.

Although my previous version has API levels 14+ but i changed my app and set following minSDK and targetSDK:

<uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="12"
        android:maxSdkVersion="17"/>

But after uploading new APK GOOGLE PLAY is showing wrong API level. It shows "API levels : 14-17". I am tired about this fact. Why not it shows 11-17 and publicly "3.0 and up".

Would anybody knows the real fact ?

iamcrypticcoder
  • 2,609
  • 4
  • 27
  • 50

4 Answers4

0

In general one can enforce the downgrading of minSdkVersion (and actually any kind of changes) by increasing the APK's versionCode -- not to be confounded with versionName! -- as that new version (with the now lowered minSdkVersion) of the APK will be prioritized at Google Play.

A similar case has been discussed in this Stackoverflow thread.

Also note that, as M.L.Murphy (2019), The Busy Coder's Guide to Android Development, CommonsWare, p.85 points out,

Your defaultConfig closure inside the android closure in your module's build.gradle file has a pair of properties named minSdkVersion and targetSdkVersion. Technically, these override values that could be defined via a <uses-sdk> element in the manifest

So in case you employ Gradle (as most developers do, as user1209216 reminded), it may be of use to check the build.gradle file for potentially conflicting {min,target,max}SdkVersion values. Actually it would be enough, and even preferable, to define these values in build.gradle and to skip them in AndroidManifest.xml. One would tie oneself to Gradle, but that's not really an argument nowadays.


P.S.: One may want to pay attention at some constraints concerning minSdkVersion, as listed in the overview on apilevels.com:

  • Google Play services do not support Android versions below API level 19.
  • Jetpack Compose requires minSdkVersion >= 21.
  • Jetpack/AndroidX libraries require minSdkVersion >= 14.

Note, that these values may change with time.

Krokomot
  • 3,208
  • 2
  • 4
  • 20
0

Sometimes google play takes time for updates to be reflected in the listing.

One thing you can try if it still shows is to remove one of the requirement android:maxSdkVersion="17" and upload it to google play and wait for a while for it to be updated.

NB: One more thing is if your app is not compatible with some of the api levels, google play may not display those api levels in their listing

sujoybyte
  • 584
  • 4
  • 19
  • Note, that the question essentially is about `minSdkVersion`. Your 2nd paragraph however involves `maxSdkVersion`, and your NB is only true for `targetSdkVersion` (see https://support.google.com/googleplay/android-developer/answer/11926878?hl=en-GB). I might be wrong, of course, so feel free to provide some references. – Krokomot Apr 28 '23 at 08:21
  • Also you might want to define "a long period". That would be helpful ;-) – Krokomot Apr 28 '23 at 08:28
  • @Krokomot I think I should have written "some days" instead (English is not my first language). Btw I have seen friends waiting for almost 2 to 3 weeks without having any issues from their side. Lastly, I said removing `maxSdkVersion` just so that google updates the listing by getting to see an update has been made regarding sdk comaptibility. – sujoybyte Apr 28 '23 at 10:38
  • I don't get the point to change `maxSdkVersion` and hope for the best, when încrementing `versionCode` guarantees an update. What do I miss? – Krokomot Apr 28 '23 at 10:49
  • What I was saying is as the `maxSdkVersion` here is very low therefore removing it, might give it priority over other apps when it goes in for google play's review queue. – sujoybyte Apr 28 '23 at 11:06
0

I don't think you should define it on AndroidManifest. Set min and target sdk in your build.gradle and remove from manifest. During compilation process, corresponding values will be added to manifest automatically.

You can also analyze your apk to determine what min/target sdk were actually applied. This can be done with apktool, or you can install apk on your phone and use AppChecker or any similar app.

You can also create blank new project with min/target sdk as you want (new project wizard always asks it) to see how it should be set, to make sure you haven't messed anything

user1209216
  • 7,404
  • 12
  • 60
  • 123
  • It has to be noted, that though your first paragraph is correct, it bounds one to Gradle. As actually not everyone uses Gradle (there are other build systems), it's still better to declare the sdkVersions and similar stuff in the AndroidManifest. At least in cases, where a usage of Gradle can not be guaranteed. – Krokomot Apr 29 '23 at 08:30
  • 1
    `it's still better to declare the sdkVersions and similar stuff in the AndroidManifest` - I can't agree. As long as you use Gradle (it's default for Android), better to set sdks in build.gradle. And note, that Gradle is recommended by Google and has full Google support, unlike other build systems. Most Android apps use Gradle: https://developer.android.com/build – user1209216 Apr 29 '23 at 17:03
  • Well, ok. I have to admit, that Gradle is for sure the dominant build system, and in that light it's preferable to put the sdkVersion-stuff into build.gradle instead of the manifest. I edited my answer respectively and referred to your comment. – Krokomot Apr 29 '23 at 17:35
-1

I think you have third-party lib that overrides your manifest so you can try this code, maybe this can help you(I didn't try them after all).

<uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="12"
        android:maxSdkVersion="17"
        tools:node="replace" />

You can try tools:node="strict" either.

In Gradle(.kts) you can change minSdk and targetSdk with this too:

android {
    compileSdk = YOUR_COMPILE_SDK

    defaultConfig {
        ...
        minSdk = YOUR_MIN_SDK
        targetSdk = YOUR_TARGET_SDK
        ...
    }
}
Shift Delete
  • 1,015
  • 6
  • 13