-2

Is it possible to target API30 while at the same time disallowing access to my app from Android 11+ devices. The Google Console forced an API30 targeting standard on updates and I do not want Android 11+ devices to have access to my app yet.

Thanks.

ChrisF
  • 134,786
  • 31
  • 255
  • 325

1 Answers1

1

You can use maxSdkVersion.

The element is ignored by the android OS itself but apparently the Google Play Store still uses it to filter devices for apps:

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.

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

You can add it in your app module's build.gradle file:

android {
    compileSdkVersion 30

    defaultConfig {
        ...
        maxSdkVersion 29
        targetSdkVersion 30
        ...
    }
}
Alexander Hoffmann
  • 5,104
  • 3
  • 17
  • 23