Kotlin バージョンに必要な AGP、D8、R8 のバージョン
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android Gradle プラグイン(AGP)と D8 / R8 コンパイラは、Kotlin バージョン 1.3 以降のクラスファイルと互換性があります。
バージョン 2.1.86(AGP 4.1 に付属)以降の D8 / R8 コンパイラは、Kotlin バージョン 1.3 のクラスファイルをサポートします。Kotlin バージョン 1.4 以降のクラスファイルについては、各 Kotlin バージョンに必要な AGP、D8、R8 の最小バージョンがあります。
次の表に、各 Kotlin バージョンに必要な AGP、D8、R8 の最小バージョンを示します。AGP は D8 と R8 とともにバンドルされているため、必要な D8 と R8 のバージョンは、AGP の外部で D8 と R8 を使用する場合、またはバンドルされたバージョンをオーバーライドする場合にのみ関連します。
Kotlin バージョン |
必要な AGP バージョン |
必要な D8 と 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 |
8.0 |
8.0.27 |
2.0 |
8.5 |
8.5.10 |
2.1 |
8.6 |
8.6.17 |
2.2 |
8.10 |
8.10.21 |
この表に記載されている AGP バージョンでは、対応する D8 / R8 コンパイラ バージョンが自動的に使用されます。
Java 8+ API の脱糖を使用する場合は、AGP バージョン 7.0(および D8 / R8 バージョン 3.0.76)が必要です。R8 は、バージョン 1.4 以降の Kotlin メタデータしか出力できません。R8 を使用して Kotlin バージョン 1.3 のメタデータを含む Kotlin ライブラリを圧縮すると、メタデータは Kotlin 1.4 形式に変換されます。Kotlin バージョン 1.4 以降では、R8 は元のバージョンを保持します。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 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."]]