Android Studio 构建系统以 Gradle 为基础,并且 Android Gradle 插件 (AGP) 添加了几项专用于构建 Android 应用的功能。下表列出了各个 Android Studio 版本所需的 AGP 版本。
| Android Studio 版本 | 所需的 AGP 版本 | |
|---|---|---|
| Meerkat | 2024.3.1 | 3.2-8.9 |
| Ladybug 功能更新 | 2024.2.2 | 3.2-8.8 |
| Ladybug | 2024.2.1 | 3.2-8.7 |
| Koala 功能更新 | 2024.1.2 | 3.2-8.6 |
| Koala | 2024.1.1 | 3.2-8.5 |
| Jellyfish | 2023.3.1 | 3.2-8.4 |
| Iguana | 2023.2.1 | 3.2-8.3 |
| Hedgehog | 2023.1.1 | 3.2-8.2 |
| Giraffe | 2022.3.1 | 3.2-8.1 |
| Flamingo | 2022.2.1 | 3.2-8.0 |
Android Studio Ladybug 功能更新 |2024 年 2 月 2 日 | Android Developers
gradle对应插件版本
| 插件版本 | 所需的最低 Gradle 版本 |
|---|---|
| 8.9 | 8.11.1 |
| 8.8 | 8.10.2 |
| 8.7 | 8.9 |
| 8.6 | 8.7 |
| 8.5 | 8.7 |
| 8.4 | 8.6 |
| 8.3 | 8.4 |
| 8.2 | 8.2 |
| 8.1 | 8.0 |
| 8.0 | 8.0 |
| 7.4 | 7.5 |
Android Gradle 插件 8.9 版本说明 | Android Studio | Android Developers
Java Runtime
Gradle runs on the Java Virtual Machine (JVM), which is often provided by either a JDK or JRE. A JVM version between 8 and 23 is required to execute Gradle. JVM 24 and later versions are not yet supported.
Executing the Gradle daemon with JVM 16 or earlier has been deprecated and will become an error in Gradle 9.0. The Gradle wrapper, Gradle client, Tooling API client, and TestKit client will remain compatible with JVM 8.
JDK 6 and 7 can be used for compilation. Testing with JVM 6 and 7 is deprecated and will not be supported in Gradle 9.0.
Any fully supported version of Java can be used for compilation or testing. However, the latest Java version may only be supported for compilation or testing, not for running Gradle. Support is achieved using toolchains and applies to all tasks supporting toolchains.
See the table below for the Java version supported by a specific Gradle release:
Java Compatibility
| Java version | Support for toolchains | Support for running Gradle |
|---|---|---|
| 8 | N/A | 2.0 |
| 9 | N/A | 4.3 |
| 10 | N/A | 4.7 |
| 11 | N/A | 5.0 |
| 12 | N/A | 5.4 |
| 13 | N/A | 6.0 |
| 14 | N/A | 6.3 |
| 15 | 6.7 | 6.7 |
| 16 | 7.0 | 7.0 |
| 17 | 7.3 | 7.3 |
| 18 | 7.5 | 7.5 |
| 19 | 7.6 | 7.6 |
| 20 | 8.1 | 8.3 |
| 21 | 8.4 | 8.5 |
| 22 | 8.7 | 8.8 |
| 23 | 8.10 | 8.10 |
| 24 | N/A | N/A |
Embedded Kotlin version
| Embedded Kotlin version | Minimum Gradle version | Kotlin Language version |
|---|---|---|
| 1.3.10 | 5.0 | 1.3 |
| 1.3.11 | 5.1 | 1.3 |
| 1.3.20 | 5.2 | 1.3 |
| 1.3.21 | 5.3 | 1.3 |
| 1.3.31 | 5.5 | 1.3 |
| 1.3.41 | 5.6 | 1.3 |
| 1.3.50 | 6.0 | 1.3 |
| 1.3.61 | 6.1 | 1.3 |
| 1.3.70 | 6.3 | 1.3 |
| 1.3.71 | 6.4 | 1.3 |
| 1.3.72 | 6.5 | 1.3 |
| 1.4.20 | 6.8 | 1.3 |
| 1.4.31 | 7.0 | 1.4 |
| 1.5.21 | 7.2 | 1.4 |
| 1.5.31 | 7.3 | 1.4 |
| 1.6.21 | 7.5 | 1.4 |
| 1.7.10 | 7.6 | 1.4 |
| 1.8.10 | 8.0 | 1.8 |
| 1.8.20 | 8.2 | 1.8 |
| 1.9.0 | 8.3 | 1.8 |
| 1.9.10 | 8.4 | 1.8 |
| 1.9.20 | 8.5 | 1.8 |
| 1.9.22 | 8.7 | 1.8 |
| 1.9.23 | 8.9 | 1.8 |
| 1.9.24 | 8.10 | 1.8 |
| 2.0.20 | 8.11 | 1.8 |
| 2.0.21 | 8.12 | 1.8 |