Set up the Android 12 SDK

Within Android Studio, you can install the Android 12 SDK as follows:

  1. Click Tools > SDK Manager.
  2. In the SDK Platforms tab, select Android 12.
  3. In the SDK Tools tab, select Android SDK Build-Tools 31.
  4. Click OK to install the SDK.

Update your app's build configuration

To access Android 12 APIs and test your app's compatibility with Android 12, open your module-level build.gradle or build.gradle.kts file, and update the compileSdkVersion and targetSdkVersion with values for Android 12:

Groovy

android {
    compileSdkVersion "android-S"

    defaultConfig {
        targetSdkVersion "S"
    }
}

Kotlin

android {
    compileSdkVersion("android-S")

    defaultConfig {
        targetSdkVersion("S")
    }
}

To learn about which changes might affect you, and to learn how to test these changes in your app, read the following topics:

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