Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wenn du mit Android 12 APIs entwickeln und deine App mit den Android 12-Verhaltensänderungen testen möchtest, musst du das Android 12 SDK einrichten. Folge der Anleitung auf dieser Seite, um das Android 12 SDK in Android Studio einzurichten und deine App unter Android 12 zu erstellen und auszuführen.
Android Studio herunterladen
Das Android 12 SDK enthält Änderungen, die mit einigen niedrigeren Versionen von Android Studio nicht kompatibel sind. Für eine optimale Entwicklung mit dem Android 12 SDK sollten Sie Android Studio Arctic Fox | 2020.3.1 oder höher verwenden.
So installieren Sie das Android 12 SDK in Android Studio:
Klicken Sie auf Tools > SDK-Manager und dann auf Paketdetails anzeigen.
Maximieren Sie auf dem Tab SDK-Plattformen den Abschnitt Android 12.0 ("S") und wählen Sie das Paket Android SDK Platform 31 aus.
Maximieren Sie auf dem Tab SDK Tools den Bereich Android SDK Build-Tools 34 und wählen Sie die neueste Version von 31.x.x aus.
Klicken Sie auf Übernehmen > OK, um die ausgewählten Pakete herunterzuladen und zu installieren.
Build-Konfiguration Ihrer App aktualisieren
Wenn du auf Android 12 APIs zugreifen und die Kompatibilität deiner App mit Android 12 testen möchtest, öffne die Datei build.gradle oder build.gradle.kts auf Modulebene und aktualisiere compileSdkVersion und targetSdkVersion mit Werten für Android 12:
Weitere Informationen zu den neuen APIs und Funktionen von Android 12 finden Sie unter Android 12-Funktionen.
Alle Inhalte und Codebeispiele auf dieser Seite unterliegen den Lizenzen wie im Abschnitt Inhaltslizenz beschrieben. Java und OpenJDK sind Marken oder eingetragene Marken von Oracle und/oder seinen Tochtergesellschaften.
Zuletzt aktualisiert: 2025-07-27 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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)."]]