简体   繁体   English

“android:maxSdkVersion”不工作

[英]"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: android:maxSdkVersion不再检查超过 Android 2.0.1 由 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.未来版本的 Android(Android 2.0.1 之后)将不再在安装或重新验证期间检查或强制执行 maxSdkVersion 属性。 Google Play will continue to use the attribute as a filter, however, when presenting users with applications available for download.但是,在向用户提供可供下载的应用程序时,Google Play 将继续使用该属性作为过滤器。

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

Switch To Android Studio切换到 Android Studio

android:maxSdkVersion — Specifies the maximum API Level on which the application is able to run. android:maxSdkVersion — 指定应用程序能够运行的最大 API 级别。

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.首先,无需将该属性设置为阻止将应用程序部署到 Android 平台新版本发布的手段。 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.您的应用程序应该在新版本上正常运行,前提是它仅使用标准 API 并遵循开发最佳实践。 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.其次,请注意,在某些情况下,声明该属性可能会导致您的应用程序在系统更新到更高的 API 级别后从用户设备中删除。 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.未来版本的Android(Android 2.0.1 之后)将不再在安装或重新验证期间检查或强制执行maxSdkVersion属性。 Google Play will continue to use the attribute as a filter, however, when presenting users with applications available for download.但是,在向用户提供可供下载的应用程序时,Google Play 将继续使用该属性作为过滤器。

  1. Read Official Document 阅读官方文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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