Playstore "This configuration cannot be published" - android

I am trying to update my apk in the play store but I am getting the following error :
This configuration cannot be published for the following reason(s):
·It is forbidden to downgrade devices which previously matched version 13 to version 1, which would occur when API levels in range 14+ and
Release track containing any of [ALPHA] and
Screen layouts containing any of [small, normal, large, xlarge] and
OpenGL ES versions in range 2.0+ and
Features containing all of [android.hardware.LOCATION, android.hardware.location.GPS, android.hardware.location.NETWORK, android.hardware.screen.PORTRAIT, android.hardware.TELEPHONY, android.hardware.TOUCHSCREEN].
·It is forbidden to downgrade devices which previously used M permissions (target SDK 23 and above) to APKs which use old style permissions (target SDK 22 and below). This occurs in the change from version 13 (target SDK 23) to version 1 (target SDK 21).
·Some devices are eligible to run multiple APKs. In such a scenario, the device will receive the APK with the higher version code.
build.gradle:
defaultConfig {
applicationId "my.project"
minSdkVersion 14
targetSdkVersion 23
versionCode 14
versionName "2.3"
}
Previous Version was :
versionCode 13
versionName "2.2"
Does the usage of third party libraries affect this. A newer version of 3rd party library was included into the project after several releases of the app.

Related

How to get "CompileSdkversion" programmatically in Android

I have an About box in my App that displays information about the App, the phone and the data it uses. It's very useful when a user has a problem. I can get the phone's SDK version using "android.os.Build.VERSION.SDK_INT". However, I haven't found a way to get the value of "CompileSdkversion" which indicates the SDK version the App was compiled with. This is the value that is set in the build.gradle file.
While the Android OS version varies by user, the compileSdkVersion does not. For version X.Y.Z of your app, the compileSdkVersion is whatever you said it was when you compiled that app version. So long as your about box contains the app version, you know what compileSdkVersion that you used, if you keep track of that (e.g., check what it was in your version control system).
But, if you really want to have it be available to you at runtime, you have two options.
If your minSdkVersion is 31 or higher, you can use compileSdkVersion on ApplicationInfo. However, most likely, if you are reading this before the year 2026, your minSdkVersion is lower than that.
For older devices than Android 12, you could add a BuildConfig field for it, at least with newer versions of the Android Gradle Plugin:
android {
compileSdk 31
defaultConfig {
applicationId "com.commonsware.android.myapplication"
minSdk 23
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "int", "COMPILE_SDK_VERSION", "$compileSdk"
}
// other stuff goes here
}
This takes your defined value for compileSdk and hoists it into BuildConfig.COMPILE_SDK_VERSION, so you can reference it at runtime. This was tested using a scrap Arctic Fox project, using Gradle 7.0.2 and 7.0.3 of the Android Gradle Plugin.
Here is the relationship between the three values:
minSdkVersion (lowest possible) <=
targetSdkVersion == compileSdkVersion (latest SDK)
CompileSdkVersion has nothing to do with what devices can and cannot run your app. Usually, you set this to be the latest version of the Android SDK.
And the targetSdkVersion should be fully tested and less or equal to compileSdkVersion.(It depends on your app)
If you are using the features of API level of 26 then you need to use compileSdkVersion 26, the lower version will give you an error.
Android supports backward compatibility
(i.e. an app compiled on 26 can also run on a phone having API level 26 or lower).
Considering your use-case, wouldn't a better approach be just to show the current app version? If you know the version, you could look up how/when it was created (via git tags, for example) and then find out the SDK version it was compiled with.

Android Studio API level error for Android Wear

I am trying to run and test a simple android application using android studio(version 3.0.1) on a smartwatch, I am getting the below error with respect to the gradle sync. (I am creating an new project by selecting the wear with the API level of 22 which is same as smartwatch API level).
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 22 cannot be smaller than version 23 declared in library [com.android.support:wear:26.1.0] C:\Users\Sai.gradle\caches\transforms-1\files-1.1\wear-26.1.0.aar\5b2a40104c2cc0843c9e44597771b49a\AndroidManifest.xml as the library might be using APIs not available in 22
Suggestion: use a compatible library with a minSdk of at most 22,
or increase this project's minSdk version to at least 23,
or use tools:overrideLibrary="android.support.wear" to force usage (may lead to runtime failures)
I have looked up for this error in most of the stackoverflow post's and they suggested to change the minimum SDK version in the build.GRADLE (app module) file in the defaultConfig section to 23, and the error doesn’t appear when I change the version to 23 as below.
defaultConfig {
applicationId "com.example.sai.wearexample"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
But, if I change the minSdkVersion version to 23 then there is the below error while I want to run the application on the smartwatch.
I have looked into many of the answers in the stackoverflow but I am not able to get any of the specific resolutions for this question. I am stuck in between these two errors, any help would be appreciated.
You should not use com.android.support:wear for api <23.
For the views you can add:
provided 'com.google.android.wearable:wearable:2.3.0'
compile 'com.google.android.support:wearable:2.3.0'
And change in your java and xml the code for use the tools of
com.google.android.wearable
instead
com.google.android.support:wearable
For example, use android.support.wearable.view.BoxInsetLayout instead of android.support.wear.widget.BoxInsetLayout.
I hope I have helped.

Why are my supported android devices so low?

Why are my supported android devices so low? I've tried to target the lowest possible apk (13), and yet only 12,000 devices can use my app.
Any help would be much appreciated!
Here is my build.gradle.
android {
signingConfigs {
}
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "thomas.surfaceviewtest"
minSdkVersion 13
targetSdkVersion 13
versionCode 5
versionName "1.0.5"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
}
}
dexOptions {
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.firebase:firebase-ads:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
That number is comparting your manifest configuration and a list of devices know by Google (see the list of devices).
It is not a number of real devices, but a number of model supported, so 12000 models on the market is a good number I believe.
Its because your target sdk level is low
targetSdkVersion 13
Update it to 25 so it will support more devices
targetSdkVersion 25
You can check for more android sdk version here
My app is compatible with 12611 devices. That is basically the same as you have. 12000 devices isn't little, especially given the fact that there are "only" 1465 unsupported devices as a result of my minSdk version being high.
Targeting 12k devices isn't little, it is a lot. If you were only targeting say 8k that would be something you should look into.
You should still change compile and minSdk versions to 25 or 26 (7.1 or 8.0) to make sure your app can run the newest API's.
I'd like to clarify the fact that targeting API 13 doesn't exclude API 14-26 from installing the app. It indicates what version it is designed for. You compile against 23 so you have the new API's included, but you only use API 13.
This should help:
android:targetSdkVersion
An integer designating the API Level that the application targets. If not set, the default value equals that given to minSdkVersion.
This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version. The application is still able to run on older versions (down to minSdkVersion).
As Android evolves with each new version, some behaviors and even appearances might change. However, if the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect. You can disable such compatibility behaviors by specifying targetSdkVersion to match the API level of the platform on which it's running. For example, setting this value to "11" or higher allows the system to apply a new default theme (Holo) to your app when running on Android 3.0 or higher and also disables screen compatibility mode when running on larger screens (because support for API level 11 implicitly supports larger screens).
Source: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html
You should your increase target sdk level.
targetSdkVersion 25

Deploying multiple APK with vector asset (android)

android studio is currently supporting vector assets. according to the literature I can
Create separate APKs for different API levels. When you don’t include
the corresponding raster images in the APK for Android 5.0 (API level
21) and higher, the APK can be much smaller in size. For more
information, see Multiple APK Support.
so I tried creating 2 APIs: -
the pre-lollipop version contains the generated pngs without the vector assets,
while the lollipop version contains only the vectors assets
In http://developer.android.com/google/play/publishing/multiple-apks.html
If an APK you've uploaded for API levels 4 and above (Android 1.6+) has a version code of 0400, then an APK for API levels 8 and above (Android 2.2+) must be 0401 or greater. In this case, the API level is the only supported filter used, so the version codes must increase in correlation with the API level support for each APK, so that users get an update when they receive a system update.
The following is my gradle build file.
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "twitch.angelandroidapps.matchit"
}
productFlavors {
lollipopConfig {
minSdkVersion 21
targetSdkVersion 23
versionCode 3
versionName "21.1.0"
}
preLollipopConfig {
minSdkVersion 10
maxSdkVersion 20
targetSdkVersion 17
versionCode 2
versionName "10.1.0"
}
}
:
//snipped the rest of the build config...
:
however, when I deploy the pre-lollipop version first, followed by the lollipop version, then the pre-lollipop version got archived (and vice-versa).
Any advice on how I can get both versions to be deployed in the play store?
I had it figured out.
When i first deploy the lollipops and pre-lollipops, they get auto-archived.
For some strange reason, I have to manually shift the pre-lollipop version back into production by clicking "Move to Prod" for it to work.
After that, the playstore will show a new "API LEVELS" column.
Also the literature about having a larger versionCode seems to be wrong. Pre-lollipop version needs to always be a lower VersionCode (probably because my API levels do not overlap?). Anyway, I can now deploy new pre-lollipop versions without getting the previous version archived.
In the end, I used the naming convention of
21xxxx for lollipop versions and
10xxxx for pre-lollipop versions
Hope it helps.

Android testers not receiving application update

I have published multiple apk android aplication. First apk is with versionCode 10106 and second apk with version 14106.
Now, i have updated application and made changes so that i dont have two apk files, but one single apk for all API's. VersionCode of new apk is 19112.
Application is published to Alpha section. None of my testers received update yet. Three days passed. I have received update 2hrs after publish, so i do not think is GooglePlay store fault.
I am using Nexus5 with Android L developer preview installed. And i am sure that some of my testers have 4.4.4 KitKat on ther phones, but again it does not make sense, because it says that there are 6324 supported devices.
Below you can see my build.gradle file.
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
applicationId "com.example"
minSdkVersion 10
targetSdkVersion 19
versionCode 19112
versionName '1.1.2'
}
buildTypes {
release {
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- project.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:19.+'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:19.+'
}
This is a warning i have on PlayStore:
A device with API levels in range 14+ is eligible to receive version 14106, which is optimized for higher API levels, but actually receives version 19112 because it has a higher version code. This would occur when
Release track containing any of [BETA] and
Screen layouts containing any of [small, normal, large, xlarge] and
OpenGL ES versions in range 2.0+ and
Features containing all of [android.hardware.screen.LANDSCAPE, android.hardware.TOUCHSCREEN].
A device upgrading from API levels in range 10-13 to API levels in range 14+ would become eligible to receive version 14106, which is optimized for higher API levels, but would actually receive version 19112 because it has a higher version code. This would occur when
Release track containing any of [BETA] and
Screen layouts containing any of [small, normal, large, xlarge] and
OpenGL ES versions in range 2.0+ and
Features containing all of [android.hardware.screen.LANDSCAPE, android.hardware.TOUCHSCREEN].
Some devices are eligible to run multiple APKs. In such a scenario, the device will receive the APK with the higher version code.
Previously active APKs supported more devices than those in the draft configuration.
Some devices will not receive upgrades.
Devices currently running version 8100 are no longer supported by the current configuration. Such devices will not receive upgrades.
API levels in range 8-9 and
Release track containing any of [ALPHA, BETA] and
Screen layouts containing any of [small, normal, large, xlarge] and
OpenGL ES versions in range 2.0+ and
Features containing all of [android.hardware.LOCATION, android.hardware.location.GPS, android.hardware.screen.LANDSCAPE, android.hardware.TELEPHONY, android.hardware.TOUCHSCREEN]

Categories

Resources