# Android Studio 版本兼容性速查表

| AGP 版本         | 所需最低 Gradle 版本 | 推荐 Gradle 版本范围 | Kotlin 插件版本范围 | 最低 JDK 版本 |
| -------------- | -------------- | -------------- | ------------- | --------- |
| 8.3.x - 8.10.x | 8.3 - 8.11.1   | 8.4 - 8.12+    | 2.0.x - 2.1.x | JDK 17    |
| 8.0.x - 8.2.x  | 8.0 - 8.2      | 8.0 - 8.3      | 1.8.x - 2.0.x | JDK 17    |
| 7.4.x          | 7.5            | 7.5 - 7.6      | 1.8.x - 1.9.x | JDK 11    |
| 7.0.x - 7.3.x  | 7.0 - 7.4      | 7.0 - 7.5      | 1.5.x - 1.8.x | JDK 11    |
| 4.2.0+         | 6.7.1          | 6.7.1 - 6.9    | 1.4.x - 1.5.x | JDK 8     |
| 4.0.0 - 4.1.0  | 6.1.1 - 6.5    | 6.1.1 - 6.7.1  | 1.3.x - 1.4.x | JDK 8     |
| 3.6.0 - 3.6.4  | 5.6.4+         | 5.6.4 - 6.5    | 1.3.x - 1.4.x | JDK 8     |

1. AGP 和 Gradle 是核心绑定关系：这是最基础的兼容性对。你需要在项目的 `gradle/wrapper/gradle-wrapper.properties` 文件中配置 Gradle 版本，并在项目根目录的 `build.gradle` 或 `settings.gradle` 文件中配置 AGP 版本 。务必保证它们符合上表的对应关系 。
2. JDK 版本有门槛：随着 AGP 版本的升级，所需的 JDK 版本也在提高。
   1. 如果你在使用 AGP 8.0.0 及以上版本，则必须使用 JDK 17 才能构建项目 。
   2. 对于 AGP 7.x 版本，最低要求是 JDK 11 。
   3. 更早的 AGP 4.x 及以下版本则可以使用 JDK 8 。你可以在 Android Studio 的 Project Structure 对话框中配置项目的 JDK 路径。
3. Kotlin 插件版本 (KGP) 需要留意：如果你使用 Kotlin 语言，需要确保 `org.jetbrains.kotlin:kotlin-gradle-plugin` 的版本与 AGP 版本兼容。官方文档提供了详细的 Kotlin 插件与 Gradle/AGP 的兼容性表 。例如，Kotlin 插件 2.3.0 版本支持 Gradle (7.6.3 - 9.0.0) 和 AGP (8.2.2 - 8.13.0) 。
4. 查看官方文档：最权威的信息源始终是 [Android 开发者官网](https://developer.android.com/studio/releases/gradle-plugin)。Google 可能会随着新版本的发布而调整对应关系，定期查阅官网可以确保你始终获得最新、最准确的信息。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rayneo.gitbook.io/rayneo-devdoc/chang-jian-wen-ti/faq/android-studio-ban-ben-jian-rong-xing-su-cha-biao.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
