I have a app on the Google Play with the following configuration. Till now I thought that Google Play uses AndroidManifest to determine the minimum and the maximum SdkVersion. Unfortunately as it reveals people could download and install this app on higher APIs.
The question is; how to set maximum API limit for this app (I guess I need to set compileSdkVersion 17 in build.gradle but I have to be sure) before publish the apk.
AndroidManifest.xml (an extract):
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
build.gradle (an extract):
android {
compileSdkVersion 19
//...
}
You are setting targetSdk Version and minSdkVersion
maxSDK Version is a different attribute.
but is discouraged to set it
heres the full version of the code, from developer.android.com
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
As the Google play store indirectly choose the version ,after upload of the apk it looks after our android manifest.xml from there it takes all the information like minsdkversion and maxsdkversion in that manner our app will support based on that values it contain..
Related
I am working on android app. Can anybody tell me that how can we restrict our app installation in android version less than 4.0 from google play developer console.
This is not set in Google Play developer console, it is set in the project's build gradle.
The setting is in build.gradle file in your application module. There should be something like this.
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
change minSdkVersion to whatever value of sdk you want to support.
Read more here: https://developer.android.com/studio/publish/versioning.html#minsdkversion
And here are the sdk int value for each Android version: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
There is no way that I know of to manage that in Developer Console. You should upload binary that was packaged with Minimum Android Version set in AndroidManifest.xml to what ever is the minimum you still want to support (4.0 in your case).
Example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="14" />
</manifest>
14 is the API Level of Android 4.0.
I've deployed a Nativescript app to Google Play for my beta testers to use. My app is only intended to support Android version 4.4 and above. So I thought setting this in the AndroidManifest would get the job done.
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="__APILEVEL__"/>
Yet once deployed the Play store is still saying that those running Android versions lower than 4.4 can still download the app. What else do I need to do to prevent this?
Follow the thread below where a solution is shown on how to modify your minimum SDK version with app.gradle
https://github.com/NativeScript/android-runtime/issues/575#issuecomment-251584253
Basically as Plamen5kov has shown, you have to do the following:
what you can do is go to app/App_Resources/Android/app.gradle and
change the default configuration to meet your requirements.
android {
defaultConfig {
minSdkVersion 19 ....
Gradle overrides the AndroidManifest.xml that's why you need to change
the configuration in gradle, rather than in the manifest file.
I uploaded an APK to the app store, it's targeting lollipop, but on Google Play Store it says "API levels 14-19". I can't seem to figure out why the max sdk level is stuck at 19.
compileSdkVersion 22 buildToolsVersion "21.1.2"
defaultConfig {
applicationId "be.appwise.test"
minSdkVersion 14
targetSdkVersion 21
versionCode 15
versionName "1.0"
Check your AndroidManifest.xml for <uses-sdk android:maxSdkVersion="19"/> Maybe you're using a library which specified this.
Google Play store will use this attribute for filtering however the attribute is generally not needed. From the docs:
By design, new versions of the platform are fully backward-compatible. Your application should work properly on new versions, provided it uses only standard APIs and follows development best practices.
If you want to remove the attribute try one of these inside the AndroidManifest.xml:
<uses-sdk tools:overrideLibrary="the library package name" />
<uses-sdk tools:node="replace" />
Disclaimer: I haven't tested these so I don't know if they work or have any side effects. Please report any results.
I'm a newbie to Android, and I'm trying to run an existing application.
In the file project.properties I have this line:
target=android-20
While in the manifest file, I have this line:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="14" />
Shouldn't these 2 directives refer to the same SDK version?
Is there any error in the app I'm trying to run?
Both of the two are different things.
minSDKVersion specifies that the app is supported minimum from which API level.
whereas targetSDKVersion mentions that which build-tool API version to be used to build the project. Both could have any value of Android API level but targetSDKVersion should not be less than minSDKVersion. Eclipse also gives error for this.
You might have noticed: when you use library method for old API than minSDKVersion API, It will raise an error asking to change the minSDKVersion. And the targetSDKVersion you are choosing in manifest file, you should have build-tool of that particular API.
Need help with an Android Play Store issue I've seen while trying to update our app.
The problem appears when the apk upload is done, and the following message shows up:
This configuration cannot be published for the following reason(s):
It is forbidden that a device upgrading from API levels in range 14-18 to API levels in range 19+ should downgrade from version 10 to version 9, which would occur when
Screen layouts containing any of [small, normal, large, xlarge] and
Features containing all of [android.hardware.LOCATION, android.hardware.location.GPS, android.hardware.screen.PORTRAIT, android.hardware.TOUCHSCREEN, android.hardware.WIFI].
Some devices are eligible to run multiple APKs. In such a scenario, the device will receive the APK with the higher version code.
What is somewhat strange is that the Play Store lists our supported API levels as 14-18, whereas our SDK settings are as follows:
/* build.gradle */
...
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "<my app id>"
minSdkVersion 14
targetSdkVersion 21
}
...
/* AndroidManifest.xml */
...
android:versionCode="10"
android:versionName="1.1.1" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
...
Another (perhaps minor) issue is that the following permission is listed under the APK DETAILS tab of the Play Store despite that we don't set this in our manifest file:
android.permission.CHANGE_WIFI_STATE
When we switch the build/target SDK version to 19 (as we previously did), Android Studio correctly complains that we are not using the latest Android version. Even then, we still see the upload problem.
Might there be something else in our configuration that is wrong?
Thanks in advance for your assistance!
OK, I finally managed to solve the issue.
Used aapt to see how Play Store would parse the apk
Found out that an external, closed-source library that I'm using sets a maxSdkVersion=18 in its manifest library
Obtained a version of the offending library that doesn't have the max SDK setting.
Recompiled the app and successfully uploaded to the play store.
An alternative to step 3 would have been to override the maxSdkVersion in my main AndroidManifest.xml file, or Disable Manifest Merger in Android Gradle Build in gradle, but Android Studio wasn't very cooperative on that front.
Admittedly, the error message on Play Store is rather cryptic and could be worded better.