irpas技术客

gradle版本/gradleplugin版本/Javajdk版本/kotlin版本_Mars-xq_gradle与jdk版本兼容

网络 2942

一、gradle 发布版本

参考:gradle 发布版本

Java版本兼容:

Java versionFirst Gradle version to support it82.094.3104.7115.0125.4136.0146.3156.7167.0177.3
二、gradle 版本和 gradle 插件版本 匹配兼容

参考:gradle 版本和 gradle 插件版本 匹配兼容

下表列出了各个 Android Gradle 插件版本所需的 Gradle 版本。为了获得最佳性能,您应使用 Gradle 和插件这两者的最新版本。

插件版本所需的 Gradle 版本1.0.0 - 1.1.32.2.1 - 2.31.2.0 - 1.3.12.2.1 - 2.91.5.02.2.1 - 2.132.0.0 - 2.1.22.10 - 2.132.1.3 - 2.2.32.14.1 - 3.52.3.0+3.3+3.0.0+4.1+3.1.0+4.4+3.2.0 - 3.2.14.6+3.3.0 - 3.3.34.10.1+3.4.0 - 3.4.35.1.1+3.5.0 - 3.5.45.4.1+3.6.0 - 3.6.45.6.4+4.0.0+6.1.1+4.1.0+6.5+4.2.0+6.7.1+7.07.0+

可以在 Android Studio 的 File > Project Structure > Project 菜单中指定插件版本,也可以在顶级 build.gradle 文件中进行指定。

三、kotlin

官网 : kotlin 版本

Kotlin Gradle Plugin : maven 仓库

Kotlin releases

Kotlin Standard Library

maven仓库 : Kotlin Stdlib : Kotlin Standard Library for JVM

问题:Kotlin version that is used for building with Gradle (+) differs from the one bundled into the IDE plugin 1.5.20 Kotlin version that is used for building with Gradle (+) differs from the one bundled into the IDE plugin 1.5.20

查看Android studio 自带kotlin插件版本(保证stable版本):

查看项目中 kotlin 插件版本,改为stable版本即可:

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"

问题 : Module was compiled with an incompatible version of Kotlin.The binary version of its metadata is 1.6.0, expected version is 1.4.0. e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors e: /Users/tmk/.gradle/caches/modules-2/files-2.1/androidx.annotation/ annotation/1.4.0-alpha01/8c16c0d1fad0d41cdac0394c7fa16a25a4210248/ annotation-1.4.0-alpha01.jar!/META-INF/annotation.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0. e: /Users/tmk/.m2/repository/org/jetbrains/kotlin/ kotlin-stdlib-common/1.6.0/kotlin-stdlib-common-1.6.0.jar!/ META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.

解决办法:

1、gradle-wrapper.properties 中将 gradle 版本升级一下

可参考:gradle版本发行

2、classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0" 将 kotlin 版本升级一下

可参考 : kotlin-gradle-plugin


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #gradle与jdk版本兼容 #一gradle #发布版本参考gradle #发布版本 #Java版本兼容Java #versionFirst #gradle #version