在 Google 控制台上阻止 Android 11+ 台设备时以 API30 为目标

Target API30 while blocking Android 11+ devices on Google Console

是否可以针对 API30 同时禁止从 Android 11+ 设备访问我的应用程序。 Google 控制台在更新时强制执行 API30 目标标准,我不希望 Android 11+ 设备访问我的应用程序。

谢谢。

您可以使用 maxSdkVersion.

该元素被 android OS 本身忽略,但显然 Google Play 商店仍使用它来过滤应用程序的设备:

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.

来源:https://developer.android.com/guide/topics/manifest/uses-sdk-element

您可以将其添加到应用模块的 build.gradle 文件中:

android {
    compileSdkVersion 30

    defaultConfig {
        ...
        maxSdkVersion 29
        targetSdkVersion 30
        ...
    }
}