Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Aby programować z użyciem interfejsów API Androida 14 i testować aplikację po zmianach w działaniu Androida 14, musisz skonfigurować pakiet SDK na Androida 14. Aby skonfigurować pakiet SDK Androida 14 w Android Studio oraz skompilować i uruchomić aplikację na Androidzie 14, wykonaj instrukcje podane na tej stronie.
Pobieranie Android Studio
Pakiet SDK Androida 14 zawiera zmiany, które są niezgodne z niektórymi starszymi wersjami Android Studio. Aby zapewnić sobie jak najlepsze wrażenia podczas tworzenia aplikacji za pomocą pakietu SDK Androida 14, użyj Android Studio Flamingo 2022.2.1 lub nowszej wersji.
W Android Studio możesz zainstalować pakiet Android 14 SDK w ten sposób:
Kliknij Narzędzia > Menedżer pakietu SDK, a potem Pokaż szczegóły pakietu.
Na karcie Platformy SDK rozwiń sekcję Android 14.0 („UpsideDownCake”) i wybierz pakiet Android SDK Platforma 34.
Na karcie Narzędzia SDK rozwiń sekcję Narzędzia Android SDK Build-Tools 34 i wybierz najnowszą wersję 34.x.x.
Aby pobrać i zainstalować wybrane pakiety, kliknij Zastosuj > OK.
Aktualizowanie konfiguracji kompilacji aplikacji
Aby uzyskać dostęp do interfejsów API Androida 14 i przetestować zgodność aplikacji z tą wersją, otwórz plik build.gradle lub build.gradle.kts na poziomie modułu i zaktualizuj go, używając wartości dla Androida 14. Sposób formatowania wartości zależy od używanej wersji wtyczki Androida do obsługi Gradle (AGP).
AGP 7.0.0 lub nowsza
Jeśli używasz standardu AGP 7.0.0 lub nowszego, w pliku build.gradle lub build.gradle.kts aplikacji podaj te wartości dla Androida 14:
Aby dowiedzieć się więcej o nowych interfejsach API i funkcjach dostępnych w Androidzie 14, przeczytaj artykuł Funkcje Androida 14.
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.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-27 UTC."],[],[],null,["# Set up the Android 14 SDK\n\nTo develop with Android 14 APIs and test your app with the Android 14 behavior\nchanges, you need to set up the Android 14 SDK. Follow the instructions on this\npage to set up the Android 14 SDK in Android Studio and build and run your app\non Android 14.\n\nGet Android Studio\n------------------\n\nThe Android 14 SDK includes changes that are not compatible with some lower\nversions of Android Studio. For the best development experience with the\nAndroid 14 SDK, use Android Studio Flamingo \\| 2022.2.1 or higher.\n\n\u003cbr /\u003e\n\n[Get Android Studio](/studio)\n\nInstall the SDK\n---------------\n\nWithin Android Studio, you can install the Android 14 SDK as follows:\n\n1. Click **Tools \\\u003e SDK Manager** , then click **Show Package Details**.\n2. In the **SDK Platforms** tab, expand the **Android 14.0 (\"UpsideDownCake\")** section and select the **Android SDK Platform 34** package.\n3. In the **SDK Tools** tab, expand the **Android SDK Build-Tools 34** section and select the latest `34.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 14 APIs and test your app's compatibility with Android 14,\nopen your module-level `build.gradle` or `build.gradle.kts` file, and update\nthem with values for Android 14. How you format the values depends on the\nversion of the Android Gradle plugin (AGP) that you are using.\n| **Note:** If you aren't quite ready to fully support Android 14, you can still perform app compatibility testing by using a debuggable app, an Android 14 device, and the [compatibility framework](/about/versions/14/reference/compat-framework-changes), without changing your app to compile with or target the SDK.\n\n### AGP 7.0.0 or higher\n\nIf you are using AGP 7.0.0 or higher, update your app's `build.gradle` or\n`build.gradle.kts` file with the following values for Android 14: \n\n### Groovy\n\n```groovy\nandroid {\n compileSdk 34\n ...\n defaultConfig {\n targetSdk 34\n }\n}\n```\n\n### Kotlin\n\n```kotlin\nandroid {\n compileSdk = 34\n ...\n defaultConfig {\n targetSdk = 34\n }\n}\n```\n\n### AGP 4.2.0 or lower\n\nIf you are using AGP 4.2.0 or lower, update your app's `build.gradle` or\n`build.gradle.kts` file with the following values for Android 14: \n\n### Groovy\n\n```groovy\nandroid {\n compileSdkVersion \"34\"\n ...\n defaultConfig {\n targetSdkVersion \"34\"\n }\n}\n```\n\n### Kotlin\n\n```kotlin\nandroid {\n compileSdkVersion = \"34\"\n ...\n defaultConfig {\n targetSdkVersion = \"34\"\n }\n}\n```\n\nNext steps\n----------\n\nTo learn about the changes that might affect your app, and to learn how to test\nthese changes in your app, read the following topics:\n\n- [Behavior changes that affect all apps](/about/versions/14/behavior-changes-all)\n- [Behavior changes that affect only apps that target Android 14](/about/versions/14/behavior-changes-14)\n\nTo learn more about new APIs and features available in Android 14, read [Android\n14 features](/about/versions/14/features)."]]