[null,null,["最后更新时间 (UTC):2025-08-21。"],[],[],null,["# Set up the Android 11 SDK\n\nAndroid 11 contains a variety of great ways you can extend your\napp. Android 11\nalso includes behavior changes to improve battery life and security, and to\n[enhance user privacy](/about/versions/11/privacy). Some of these behavior changes [only affect apps that\ntarget Android 11](/about/versions/11/behavior-changes-11), while others [affect all apps when they are running on an\nAndroid 11 device](/about/versions/11/behavior-changes-all), regardless of an app's `targetSDKVersion`.\n\nTo develop with Android 11 APIs and test your app with the\nAndroid 11 behavior changes, follow the instructions on this page\nto set up the Android 11 SDK in Android Studio and build and run\nyour app on Android 11.\n\nGet Android Studio\n------------------\n\nThe Android 11 SDK includes changes that are not compatible with\nsome lower versions of Android Studio. For the best development experience with\nthe Android 11 SDK, use Android Studio 4.2 or higher.\n\n[Get Android Studio](/studio)\n\nYou can compile and test Android 11 apps using Android Studio\n3.3 and higher, but some users of the Android 11 SDK may\nencounter Gradle sync failures and warnings about outdated dependencies.\nRemember, you can keep your existing version of Android Studio installed,\nbecause you can [install multiple versions side by side](/studio/preview/install-preview).\n\nGet the Android 11 SDK\n----------------------\n\nAfter you install and open Android Studio, install the Android 11\nSDK as follows:\n\n1. Click **Tools \\\u003e SDK Manager** , then click **Show Package Details**.\n2. In the **SDK Platforms** tab, expand the **Android 11.0 (\"R\")** section and select the **Android SDK Platform 30** package.\n3. In the **SDK Tools** tab, expand the **Android SDK Build-Tools 34** section and select the latest `30.x.x` version.\n4. Click **Apply \\\u003e OK** to download and install the selected packages.\n\nUpdate your build configuration\n-------------------------------\n\nChanging your app's build configuration to target Android 11 gives your app\naccess to the Android 11 APIs and lets you fully test your app's compatibility\nas you [prepare to add full support for Android 11](/about/versions/11/migration#setup_sdk). To do this, open your\nmodule-level `build.gradle` file and update the `compileSdkVersion` and\n`targetSdkVersion`: \n\n### Groovy\n\n```groovy\nandroid {\n compileSdkVersion 30\n\n defaultConfig {\n targetSdkVersion 30\n }\n ...\n}\n```\n\n### Kotlin\n\n```kotlin\nandroid {\n compileSdkVersion(30)\n\n defaultConfig {\n targetSdkVersion(30)\n }\n ...\n}\n```\n| **Note:** If you're not ready yet to fully support Android 11, you can still perform app compatibility testing using a debuggable app, an Android 11 device, and the [compatibility framework](/guide/app-compatibility/test-debug), without changing either your app's `compileSdkVersion` or `targetSdkVersion`.\n\nTo learn about the changes in Android 11 that might affect your\napp so you can begin testing for them, read the following pages:\n\n- [Android 11 behavior changes affecting all apps](/about/versions/11/behavior-changes-all)\n- [Android 11 behavior changes affecting apps that target Android 11](/about/versions/11/behavior-changes-11)\n- [Android 11 privacy changes](/about/versions/11/privacy)\n\nTo learn more about new APIs available in Android 11, read\n[Android 11 features and APIs](/about/versions/11/features)."]]