Set up the Android 11 SDK

Android 11 contains a variety of great ways you can extend your app. Android 11 also includes behavior changes to improve battery life and security, and to enhance user privacy. Some of these behavior changes only affect apps that target Android 11, while others affect all apps when they are running on an Android 11 device, regardless of an app's targetSDKVersion.

To develop with Android 11 APIs and test your app with the Android 11 behavior changes, follow the instructions on this page to set up the Android 11 SDK in Android Studio and build and run your app on Android 11.

Get Android Studio

The Android 11 SDK includes changes that are not compatible with some lower versions of Android Studio. For the best development experience with the Android 11 SDK, use Android Studio 4.2 or higher.

Get Android Studio

You can compile and test Android 11 apps using Android Studio 3.3 and higher, but some users of the Android 11 SDK may encounter Gradle sync failures and warnings about outdated dependencies. Remember, you can keep your existing version of Android Studio installed, because you can install multiple versions side by side.

Get the Android 11 SDK

After you install and open Android Studio, install the Android 11 SDK as follows:

  1. Click Tools > SDK Manager, then click Show Package Details.
  2. In the SDK Platforms tab, expand the Android 11.0 ("R") section and select the Android SDK Platform 30 package.
  3. In the SDK Tools tab, expand the Android SDK Build-Tools 34 section and select the latest 30.x.x version.
  4. Click Apply > OK to download and install the selected packages.

Update your build configuration

Changing your app's build configuration to target Android 11 gives your app access to the Android 11 APIs and lets you fully test your app's compatibility as you prepare to add full support for Android 11. To do this, open your module-level build.gradle file and update the compileSdkVersion and targetSdkVersion:

Groovy

android {
    compileSdkVersion 30

    defaultConfig {
        targetSdkVersion 30
    }
    ...
}

Kotlin

android {
    compileSdkVersion(30)

    defaultConfig {
        targetSdkVersion(30)
    }
    ...
}

To learn about the changes in Android 11 that might affect your app so you can begin testing for them, read the following pages:

To learn more about new APIs available in Android 11, read Android 11 features and APIs.