The Android 16 Beta is now available.
Try it out today and let us know what you think!
Konfigurowanie pakietu SDK 12L
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Aby programować przy użyciu interfejsów API 12L i testować aplikację, musisz skonfigurować pakiet SDK 12L.
Postępuj zgodnie z instrukcjami na tej stronie, aby skonfigurować pakiet Android 12 SDK w Android Studio oraz skompilować i uruchomić aplikację w wersji 12L.
Pobierz Android Studio
Pakiet SDK 12L zawiera zmiany, które są niezgodne z niektórymi starszymi wersjami Android Studio. Aby zapewnić sobie jak najlepsze warunki do tworzenia aplikacji z użyciem pakietu SDK 12L, użyj Android Studio Chipmunk | 2021.2.1 lub nowszej wersji.
Pobierz Android Studio
Zainstaluj pakiet SDK
Pakiet SDK 12L możesz zainstalować w Android Studio w ten sposób:
- Kliknij kolejno Narzędzia > Menedżer pakietów SDK i Pokaż szczegóły pakietu.
- Na karcie Platformy SDK rozwiń sekcję Android 12L („Sv2”) i wybierz pakiet Android SDK Platform 32.
- Na karcie Narzędzia SDK rozwiń sekcję Narzędzia Android SDK Build-Tools 34 i wybierz najnowszą wersję
32.x.x
.
- Kliknij Zastosuj > OK, aby pobrać i zainstalować wybrane pakiety.
Aktualizowanie konfiguracji kompilacji aplikacji
Aby uzyskać dostęp do interfejsów API 12L i przetestować zgodność aplikacji z tą wersją, otwórz plik build.gradle
lub build.gradle.kts
na poziomie modułu i zaktualizuj wartości compileSdkVersion
i targetSdkVersion
zgodnie z wersją 12L:
Groovy
android {
compileSdkVersion "32"
defaultConfig {
targetSdkVersion "32"
}
}
Kotlin
android {
compileSdkVersion("32")
defaultConfig {
targetSdkVersion("32")
}
}
Więcej informacji o funkcjach i zmianach w Androidzie 12L znajdziesz w artykule Funkcje i zmiany w Androidzie 12L.
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-27 UTC."],[],[],null,["# Set up the 12L SDK\n\nTo develop with the 12L APIs and test your app, you need to set up the 12L SDK.\nFollow the instructions on this page to set up the Android 12 SDK in Android\nStudio and build and run your app on 12L.\n\nGet Android Studio\n------------------\n\nThe 12L SDK includes changes that are not compatible with some lower versions of\nAndroid Studio. For the best development experience with the 12L SDK, use\nAndroid Studio Chipmunk \\| 2021.2.1 or higher.\n\n[Get Android Studio](/studio)\n\nInstall the SDK\n---------------\n\nWithin Android Studio, you can install the 12L SDK as follows:\n\n1. Click **Tools \\\u003e SDK Manager** , then click **Show Package Details**.\n2. In the **SDK Platforms** tab, expand the **Android 12L (\"Sv2\")** section and select the **Android SDK Platform 32** package.\n3. In the **SDK Tools** tab, expand the **Android SDK Build-Tools 34** section and select the latest `32.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 12L APIs and test your app's compatibility with 12L, open your\nmodule-level `build.gradle` or `build.gradle.kts` file, and update the\n`compileSdkVersion` and `targetSdkVersion` with values for 12L: \n\n### Groovy\n\n```groovy\nandroid {\n compileSdkVersion \"32\"\n\n defaultConfig {\n targetSdkVersion \"32\"\n }\n}\n```\n\n### Kotlin\n\n```kotlin\nandroid {\n compileSdkVersion(\"32\")\n\n defaultConfig {\n targetSdkVersion(\"32\")\n }\n}\n```\n\nTo learn more about the features and changes in 12L, see [12L features and\nchanges](/about/versions/12/12L/summary)."]]