I recently updated minSdkVersion to 28, compiled a signed release build and noticed that file size increased from 9.2 to 20.3 MB. Changed it back to 27 (only thing changed), cleaned a created a second signed release build. Then used Analyze APK in Android Studio to compare the two:
Analyze APK
The Raw file size of classes.dex and classes2.dex jumped from 3.4/3.3 MB to 9.3/8.2 MB with the same number of referenced methods. Is there anyone that knows why?
A few notes: The targetSdkVersion is 31. The app is not distributed via Google Play. Shrinking (minifyEnabled) is false and should not be turned on for various reasons. I am more interested in what is actually causing this than suggestions on how to decrease the file size.
I also compiled with minSdkVersion 29, 30, 31, 32, and 33 without seeing any big differences between 28 and up.
Related
I have an existing app in the play store which is in APK format. I created the next release as .aab. When I uploaded the file, the play console shows the message that the release will stop support for over 1000 devices. How can I reduce this number?
minsdk 19
targetsdk 28
I would also like to mention that I have not edited the build.gradle since the last release. Really appreciate any help.
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"
}
I have an app on the play store that that I am receiving crash reports from and have noticed that there are some crashes that are specific to an android version ( 4.0 - 4.4 ). I want to send out an update to only those android versions. How do I go about doing that because the play store doesn't give me any such option. The minimum api version I am targeting is 16 with a targetSDK version of 27. Do i need to change those values and make a target sdk version of 19 instead and push out the update? If so will it affect the availability of the app to devices with a higher api level?
This can be done in the Play store with a Multiple APK configuration.
Suppose the current version of your app has versionCode 100. You produce a new version with versionCode 101, which has:
minSdkVersion 14 (ICS, version 4.0)
maxSdkVersion 19 (KitKat, version 4.4)
You then create a release which has both version code 101 and version code 100 in it.
To make things slightly more complicated, you should think about a user who has a KitKat phone and upgrades their Android version. They would then be matched with version 100, but this would be a downgrade from versionCode 101 to versionCode 100, and downgrades are not allowed. So you should also produce a version 102 which is exactly the same as 100.
Because this is so complicated, it might be easier to just deliver the update to everyone, and keep a single APK.
When I try to upload the apk to store I get these warnings
Partially upgradable APK
WARNING
Some users of this APK may not be able to upgrade to any of the new APKs added in this release.
CAUTION
Users that currently have APK with version code 53, which targets SDK 22 or lower, will be eligible to upgrade to this APK. However, once users upgrade to this APK, they will be unable to upgrade to APKs that target SDK 22 or lower.
Following datas are my current build details
compileSdkVersion 26
buildToolsVersion 26.0.2
minSdkVersion 15
targetSdkVersion 26
This is my previous update details
compileSdkVersion 25
buildToolsVersion "25.0.3"
minSdkVersion 15
targetSdkVersion 22
This warning is because yoy have upgraded your api higher than 22 that means you have to handle some runtime permisions. The warning says that this is a one way switch i.e there is no way of coming back to targeting API 22 or earlier once you make the switch to the runtime permission model.The developer console is just confirming that you have done all the thing need for runtime permissions so no need to worry.
It is normal but in your case - you need to be careful since you target several levels higher.
Warning: Users using previous build would not be able to install the
update simply because of difference in permission models and higher
compile - 26. So if you don't make sure that you handle new permission
models and other functionalities, you may tend to lose part of your
users.
Caution: Users once they update to the new build will not be
able to upgrade back to lesser build of the same App. This means once
you publish your App in higher build successfully, you can't go back
to lesser build targets in your next update. Make sure all your
functionalities work in the new build before deploying.
Thanks
Its simply ok.
Warning indicates that once you increase your target version higher than your previous target version then users get update to newer targeted version app. But then after they cant receive update for lower target version.
But make sure you have handled Runtime Permission Model Properly for all dangerous group permission.
Rather than it does not affect your user base or nor your app functionality.
Happy Coding..
I read that if we want to update an app in google play, the version Code should be higher than the previous apk file. I've an app with version code: 20 and version name 1.0. So to update the app, how should I increase the version code? Should it increase by 10? or just 1 is enough? ie, version code from 20 to 30 or version code from 20 to 21?
VersionCode
This number is used only to determine whether one version is more
recent than another, with higher numbers indicating more recent
versions. Typically, you would release the first version of your app
with versionCode set to 1, then monotonically increase the value with
each release, regardless whether the release constitutes a major or
minor release. This means that the versionCode value does not
necessarily have a strong resemblance to the app release version that
is visible to the user (see versionName, below). Apps and publishing
services should not display this version value to users.
defaultConfig
{
minSdkVersion 17
targetSdkVersion 23
versionCode 1 // Default , You can increase 1 when update .
versionName "1.0"
}
You can use the Play Core Library In-app updates to tackle this. You can check for update availability and install them if available seamlessly.
In-app updates are not compatible with apps that use APK expansion files (.obb files). You can either go for flexible downloads or immediate updates which Google Play takes care of downloading and installing the update for you.
dependencies {
implementation 'com.google.android.play:core:1.5.0'
...
}
Note that, In-app updates works only with devices running Android 5.0 (API level 21) or higher, and requires you to use Play Core library 1.5.0 or higher.
'
I hope this will help somebody
I increased it from code 1 and version 1.0 to code 2 and version 1.1 . That's also what it says in my developer console. So just do as you wish
Basically, For update your apk you should update version code to 21(just 1 increase) and your version name.