Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Si quieres desarrollar tu app con las API de Android 12 y probarla con los cambios en el comportamiento de esta versión, debes configurar el SDK de Android 12. Sigue las instrucciones que se incluyen en esta página para configurar el SDK de Android 12 en Android Studio, y compilar y ejecutar tu app en Android 12.
Descarga Android Studio
En el SDK de Android 12, se incluyen cambios que no son compatibles con algunas versiones anteriores de Android Studio. Para obtener la mejor experiencia de desarrollo con el SDK de Android 12, usa Android Studio Arctic Fox | 2020.3.1 o una versión posterior.
En Android Studio, puedes instalar el SDK de Android 12 de la siguiente manera:
Haz clic en Tools > SDK Manager y, luego, en Show Package Details.
En la pestaña SDK Platforms, expande la sección Android 12.0 ("S") y selecciona el paquete Android SDK Platform 31.
En la pestaña SDK Tools, expande la sección Android SDK Build-Tools 34 y selecciona la versión 31.x.x más reciente.
Haz clic en Apply > OK para descargar e instalar los paquetes seleccionados.
Cómo actualizar la configuración de compilación de tu app
Para acceder a las APIs de Android 12 y probar la compatibilidad de tu app con Android 12, abre el archivo build.gradle o build.gradle.kts a nivel del módulo, y actualiza compileSdkVersion y targetSdkVersion con valores para Android 12:
Para obtener más información sobre las nuevas APIs y funciones disponibles en Android 12, lee Funciones de Android 12.
El contenido y las muestras de código que aparecen en esta página están sujetas a las licencias que se describen en la Licencia de Contenido. Java y OpenJDK son marcas registradas de Oracle o sus afiliados.
Última actualización: 2025-07-27 (UTC)
[null,null,["Última actualización: 2025-07-27 (UTC)"],[],[],null,["# Set up the Android 12 SDK\n\nTo develop with Android 12 APIs and test your app with the Android 12 behavior\nchanges, you need to set up the Android 12 SDK. Follow the instructions on this\npage to set up the Android 12 SDK in Android Studio and build and run your app\non Android 12.\n\nGet Android Studio\n------------------\n\nThe Android 12 SDK includes changes that are not compatible with some lower\nversions of Android Studio. For the best development experience with the Android\n12 SDK, use Android Studio Arctic Fox \\| 2020.3.1 or higher.\n\n[Get Android Studio](/studio)\n\nInstall the SDK\n---------------\n\nWithin Android Studio, you can install the Android 12 SDK as follows:\n\n1. Click **Tools \\\u003e SDK Manager** , then click **Show Package Details**.\n2. In the **SDK Platforms** tab, expand the **Android 12.0 (\"S\")** section and select the **Android SDK Platform 31** package.\n3. In the **SDK Tools** tab, expand the **Android SDK Build-Tools 34** section and select the latest `31.x.x` version.\n4. Click **Apply \\\u003e OK** to download and install the selected packages.\n\nUpdate your app's build configuration\n-------------------------------------\n\nTo access Android 12 APIs and test your app's compatibility with Android 12,\nopen your module-level `build.gradle` or `build.gradle.kts` file, and update the\n`compileSdkVersion` and `targetSdkVersion` with values for Android 12: \n\n### Groovy\n\n```groovy\nandroid {\n compileSdkVersion 31\n\n defaultConfig {\n targetSdkVersion 31\n }\n}\n```\n\n### Kotlin\n\n```kotlin\nandroid {\n compileSdkVersion(31)\n\n defaultConfig {\n targetSdkVersion(31)\n }\n}\n```\n| **Note:** If you aren't quite ready to fully support Android 12, you can still perform app compatibility testing by using a debuggable app, an Android 12 device, and the [compatibility framework](/about/versions/12/reference/compat-framework-changes), without changing either your app's `compileSdkVersion` or `targetSdkVersion`.\n\nTo learn about which changes might affect you, and to learn how to test these\nchanges in your app, read the following topics:\n\n- [Behavior changes that affect all apps](/about/versions/12/behavior-changes-all)\n- [Behavior changes that affect only apps that target Android 12](/about/versions/12/behavior-changes-12)\n\nTo learn more about new APIs and features available in Android 12, read [Android\n12 features](/about/versions/12/features)."]]