简体   繁体   中英

"android:maxSdkVersion" is not working

Preparing application with following configuration:

<uses-sdk
    android:maxSdkVersion="18"
    android:targetSdkVersion="17"
    android:minSdkVersion="8" />

But application installing properly on lollipop devices. Can anyone explain the matter why this is occurred.

android:maxSdkVersion is no longer checked beyond Android 2.0.1 as stated by developer.google.com:

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.

Reference:
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#max

Switch To Android Studio

android:maxSdkVersion — Specifies the maximum API Level on which the application is able to run.

Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. 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. Second, note that in some cases, declaring the attribute can result in your application being removed from users' devices after a system update to a higher API Level. Most devices on which your application is likely to be installed will receive periodic system updates over the air, so you should consider their effect on your application before setting this attribute.

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.

  1. Read Official Document

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM