On November 1st, 2018, Google play started requiring apps to target API Level 26 at a minimum. API level 26 is not terribly old, leaving a large number of potential users who are still using phones that do not support API level 26. I want to find a way to still support those older phones via Google play by uploading an apk file that targets a lower API level (say, 21). However, google play doesn't seem to let me do that. Is this something I should be able to do? If so, how?
According to this article, I should be able to offer multiple apk files: https://developer.android.com/google/play/publishing/multiple-apks#CreatingApks
I followed the method described in this youtube video to upload my apk's: https://www.youtube.com/watch?v=rMl_oLlf_g0
However, it seems like no matter what I do, the play console tells me that the API-Level-21 APK must target at least API level 26. I'm stumped...
You can still support older phones while compiling against the latest SDK version.
Google is requiring you to compile against at minimum SDK 26 which would be the targetSdkVersion in your gradle file.
To declare what version you want to minimum support you use the minSdkVersion in your gradle file too
Your gradle file would look something like this
defaultConfig {
applicationId "my.package.name"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Related
My Android APP has a minimum SDK 16. Recently, I want to update the Admob library to the latest version, it requires minimum SDK 19. If I publish the APP bundles with minSdk 19 to Google Play, it will replace the APP bundles with minSdk 16 completely. Then all users under API level 19 will upgrade to a very early version, which causes a lot of crashes. Several years ago, we could publish multiple APKs, and target different API levels by version code. How can I do the same thing with APP bundles?
defaultConfig {
minSdkVersion 16
}
dependencies {
implementation 'com.google.android.gms:play-services-ads:20.6.0'
}
My app stop working on Android Pie but my project (very old!) is
compileSdkVersion 21
minSdkVersion 14
targetSdkVersion 21
Do you think I need to rewrite the code that uses WiFiManager to respect the latest Android security restrictions?
You won't be able to publish to Google Play unless you target API 26+, so if you want to publish to Google Play or provide a experience that is consistent with other modern apps, you would need to rewrite your WifiManager code to comply with the latest Android security restrictions.
A library that I'm using requires minSdkVersion to be 15.
The app is already published in the store with minSdkVersion 14.
If I bump minSdkVersion from 14 to 15 for the new app version, will users with 14 be able to upgrade to it? Or is it only going to hide it from the Google App Store with users running Android API 14?
minSdkVersion refer to the minimum version that your application is supported. By upgrading from 14 to 15, any users who are using phone with API level 14(ICS) will not be able to access any apps above 14.
I know this question had been asked in different versions already many times, but none of the answers helped me. I developped an app, that works fine on my mobile phone, but often can not be installed on the phones of my friends. I checked the device features my app needs, but they don't seem very unusual. the android minSdkVersion is also ok, and the apk has a normal size
I can not reproduce this problem on the emulator. even one of my apps, which is not compatible with my tablet on Google play, works perfectly when I run it locally while developing. so how do I find out, what device feature, or what other problem is preventing my app from being installed?
Here is the link to one of my apps on google play that causes this problem: serial call
I guess the "problem" is your android:minSdkVersion value.
android:minSdkVersion
Check min sdk version in manifest file under app folder in android studio. Match with device's api level and change it accordingly.
android {
compileSdkVersion 19
buildToolsVersion "19.1"
defaultConfig {
applicationId "com.example.my.app"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
How set the android max sdk version on build.gradle at android studio.
I want do an app with two flavor, the first will run between version x~y and the second run at y+
Before on eclipse, in AndroidManifest.xml we have android:maxSdkVersion="y" but how it works on gradle?
You cannot set the maxSdkVersion in gradle. Actually, it is discourage by Google because of several issues. The main issue is that Google Play could decide to remove an app from a user device during an update if the system doesn't meet the maxSdkVersion specified in the app. For example, imagine you have a device with API Level 12 and you install an app with android:maxSdkVersion="12", then later you receive a system update that upgrades your android version to API Level 13...Google Play will uninstall your app.
Basically, you don't need this setting and you can easily ignore it, use the targetSDkVersion attribute and the minSdkVersion.
For your app "in flavour 1" with "version x~y" set the minSdkversion to x and the targetSdkVersion to y
now, for the app "in flavour 2", you will need to make sure that the sdk version don't get overlapped by the app "in flavour 1", set the min sdk version to "z". Otherwise, users with a device with api level "y" will never get to see this app in Google Play
Please note this.
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation. Google Play will continue to use the attribute as a filter, however, when presenting users with applications available for download.
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html
I think accepted answer is not correct. Accepted answer says it is not possible to set maxSdkVersion - it is not true. It is still possible to use maxSdkVersion in android studio app/build.gradle. As described here https://developer.android.com/guide/topics/manifest/uses-sdk-element developer must notice warning and should understand why wants to do it. Nobody here take care that in play store you can provide several bundles/packages at once (per update/release) and one bundle can be targeted for new devices and another for old devices so it is fine second one limit by maxSdkVersion. One app bundle have versionCode e.g. 2xyz and for older devices is versionCode 1xyz and google always installs higher code when minSdkVersion allows it. So developer can purposely set maxSdkVersion and he know why hi is doing it.
Each our app update have 2 packages with different app/build.gradle...
For old devices
(maxSdkVersion has sense here)
defaultConfig {
minSdkVersion 16
maxSdkVersion 23
targetSdkVersion 30
versionCode 1058
versionName "4.4.0"
}
For new devices
(without limiting maxSdkVersion as googole warns that should not be used)
defaultConfig {
minSdkVersion 24
targetSdkVersion 30
versionCode 2058
versionName "4.4.0"
}