Set up the Android 11 SDK

Android 11 is the next major release of the Android, with a variety of great new ways you can extend your app. Android 11 also includes behavior changes pages (for apps targeting R and for all apps) to help improve battery life and security, as well as privacy changes, and these will affect your app on devices running the new version of Android.

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 Preview SDK in Android Studio and build and run your app on Android 11.

Get the latest Android Studio Preview

The Android 11 Preview SDK includes changes that are not compatible with some older versions of Android Studio. So, for the best development experience with the Android 11 Preview SDK, we recommend that you install the latest preview version of Android Studio 4.0 Preview.

Get Android Studio 4.0 Preview

You can compile and test Android 11 apps using Android Studio 3.3 and higher, but some users of the Android 11 Preview 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 Preview SDK

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

  1. Click Tools > SDK Manager.
  2. In the SDK Platforms tab, select Android R Preview.
  3. In the SDK Tools tab, select Android SDK Build-Tools 30 (or higher).
  4. Click OK to begin install.

Update your build configuration

To fully test your app's compatibility with Android 11 and begin using new APIs, open your module-level build.gradle file and update the compileSdkVersion and targetSdkVersion as shown here:

android {
    compileSdkVersion 'android-R'

    defaultConfig {
        targetSdkVersion 'R'

To learn about the changes in Android 11 that might affect your app and begin testing them, read Android 11 behavior changes affecting all apps, Android 11 behavior changes affecting apps targeting Android 11, and Android 11 privacy changes.

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