Wersje AGP, D8 i R8 wymagane w przypadku wersji Kotlin
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wtyczka Android Gradle (AGP) oraz kompilatory D8 i R8 są zgodne z plikami klasy w wersji Kotlin 1.3 lub nowszej.
Kompilatory D8 i R8 obsługują pliki klasy z wersji 1.3 języka Kotlin od wersji 2.1.86 (dołączonej do AGP 4.1).
W przypadku plików klasy w wersji Kotlin 1.4 lub nowszej wymagana jest minimalna wersja AGPT, D8 i R8 dla każdej wersji Kotlina.
Poniższa tabela zawiera minimalne wymagane wersje AGP, D8 i R8 dla każdej wersji Kotlina. Pamiętaj, że AGP jest dostarczany w pakiecie z D8 i R8, więc wymagana wersja D8 i R8 jest istotna tylko wtedy, gdy używasz D8 i R8 poza AGP lub zastępujesz wersję w pakiecie.
Wersja Kotlina |
Wymagana wersja AGP |
Wymagana wersja D8 i R8 |
1.3 |
4.1 |
2.1.86 |
1,4 |
7,0 |
3.0.76 |
1,5 |
7,0 |
3.0.77 |
1,6 |
7.1 |
3.1.51 |
1.7 |
7.2 |
3.2.47 |
1,8 |
7.4 |
4.0.48 |
1.9 |
z Androidem 8.0 |
8.0.27 |
2,0 |
8.5 |
8.5.10 |
2.1 |
8,6 |
8.6.17 |
2.2 |
8.10 |
10.08.2021 |
Wersje AGP wymienione w tabeli automatycznie używają określonych wersji kompilatorów D8 i R8.
Jeśli używasz desugaringu interfejsu API w Java 8 lub nowszej wersji, wymagana jest wersja AGPL 7.0 (a także wersja D8 i R8 3.0.76).
R8 może emitować tylko metadane Kotlina w wersji 1.4 lub nowszej. Gdy używasz R8 do kompresowania biblioteki Kotlina z metadanymi z wersji Kotlina 1.3, metadane są konwertowane do formatu Kotlina 1.4. W przypadku wersji 1.4 i nowszych Kotlina R8 zachowuje wersję.
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,["# AGP, D8, and R8 versions required for Kotlin versions\n\nThe Android Gradle plugin (AGP) and the D8 and R8 compilers are compatible with\nclass files from Kotlin version 1.3 and higher.\n\nThe D8 and R8 compilers support class files from Kotlin version 1.3 starting\nfrom version 2.1.86 (included in AGP 4.1).\nFor class files from Kotlin version 1.4 and higher there is a minimum required\nAGP, D8, and R8 version for each Kotlin version.\n\nThe following table shows the minimum required versions of AGP, D8 and R8 for\neach Kotlin version. Note that AGP comes bundled with D8 and R8, so the\nrequired D8 and R8 version is only relevant when using D8 and R8 outside of AGP\nor if overriding the bundled version.\n\n| Kotlin version | Required AGP version | Required D8 and R8 version |\n|----------------|----------------------|----------------------------|\n| 1.3 | 4.1 | 2.1.86 |\n| 1.4 | 7.0 | 3.0.76 |\n| 1.5 | 7.0 | 3.0.77 |\n| 1.6 | 7.1 | 3.1.51 |\n| 1.7 | 7.2 | 3.2.47 |\n| 1.8 | 7.4 | 4.0.48 |\n| 1.9 | 8.0 | 8.0.27 |\n| 2.0 | 8.5 | 8.5.10 |\n| 2.1 | 8.6 | 8.6.17 |\n| 2.2 | 8.10 | 8.10.21 |\n\n\u003cbr /\u003e\n\nThe AGP versions listed in the table automatically use the\nspecified D8 and R8 compiler versions.\n\nWhen using [Java 8+ API desugaring](/studio/build/library-desugaring)\nAGP version 7.0 (and D8 and R8 version 3.0.76) is required.\nR8 can only emit Kotlin metadata of version 1.4 and newer. When using R8 to\nshrink a Kotlin library with metadata from Kotlin version 1.3 the metadata\nis converted to the Kotlin 1.4 format. For Kotlin version 1.4 and newer R8\npreserves the version."]]