Android Studio 开发环境兼容性检索(AGP / Gradle / Kotlin / JDK)

本表检索了 Android 项目中常用构建工具的兼容性关系,包括:

  • AGP(Android Gradle Plugin)
  • Gradle(构建工具)
  • KGP(Kotlin Gradle Plugin)
  • JDK(Java Development Kit)
  • compileSdkVersion(编译 API 上限)

📊 全版本兼容性总表

AGP 版本最低 Gradle最高 GradleKotlin 插件版本范围最低 JDK支持的 compileSdk状态
3.6.x5.6.46.51.3.x – 1.4.xJDK 8≤ 29(Android 10)❌ 过时
4.0.x6.1.16.51.3.x – 1.4.xJDK 8≤ 30❌ 过时
4.1.x6.56.7.11.4.x – 1.5.xJDK 8≤ 30❌ 过时
4.2.x6.7.16.91.4.x – 1.5.xJDK 8≤ 30⚠️ 部分兼容
7.0.x7.07.21.5.x – 1.6.xJDK 11≤ 31(Android 12)✅ 稳定
7.1.x7.27.31.5.x – 1.6.xJDK 11≤ 32✅ 稳定
7.2.x7.37.41.6.x – 1.7.xJDK 11≤ 32/33✅ 稳定
7.3.x7.47.51.7.x – 1.8.xJDK 11≤ 33(Android 13)✅ 稳定
7.4.x7.57.61.8.x – 1.9.xJDK 11≤ 33✅ 推荐
8.0.x8.08.11.8.x – 1.9.xJDK 17≤ 34(Android 14)✅ 推荐
8.1.x8.18.21.9.x – 2.0.xJDK 17≤ 34✅ 推荐
8.2.x8.28.31.9.22 – 2.0.xJDK 17≤ 34✅ 稳定
8.3.x8.38.42.0.x – 2.1.xJDK 17≤ 35(Android 15)✅ 最新
8.10.0+8.11.18.12+2.1.xJDK 17≥ 34 / 35+✅ 最新

✅ 推荐构建组合(2025)

✔ 稳定生产环境推荐

# gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
// build.gradle
plugins {
    id 'com.android.application' version '8.2.0' apply false
    id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
}
  • JDK:17
  • compileSdk:34

✔ 最新功能体验环境(适用于 Jetpack Compose 1.6+ 、Android 15)

# gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
// build.gradle
plugins {
    id 'com.android.application' version '8.10.0' apply false
    id 'org.jetbrains.kotlin.android' version '2.1.20' apply false
}
  • JDK:17
  • compileSdk:35

📌 常见注意事项

  • AGP ≥ 8.0 必须使用 JDK 17
  • Gradle 与 AGP 是强绑定关系,版本不兼容会构建失败
  • Kotlin 插件版本应与 Kotlin 编译器一致,否则 kapt 、Compose 等可能异常
  • 已废弃配置项(如 android.bundle.enableUncompressedNativeLibs)在 AGP 8.1+ 已移除
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值