当前位置:   article > 正文

gradle版本/gradleplugin版本/Javajdk版本/kotlin版本_org.jetbrains.kotlin:kotlin-gradle-plugin版本

org.jetbrains.kotlin:kotlin-gradle-plugin版本

一、gradle 发布版本

参考:gradle 发布版本

Java版本兼容:

Java versionFirst Gradle version to support it
82.0
94.3
104.7
115.0
125.4
136.0
146.3
156.7
167.0
177.3

二、gradle 版本和 gradle 插件版本 匹配兼容

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

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

插件版本所需的 Gradle 版本
1.0.0 - 1.1.32.2.1 - 2.3
1.2.0 - 1.3.12.2.1 - 2.9
1.5.02.2.1 - 2.13
2.0.0 - 2.1.22.10 - 2.13
2.1.3 - 2.2.32.14.1 - 3.5
2.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
  • 1
  • 2

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

在这里插入图片描述

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

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

在这里插入图片描述

问题 : 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
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

解决办法:

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

可参考:gradle版本发行

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

可参考 : kotlin-gradle-plugin

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/223376
推荐阅读
相关标签
  

闽ICP备14008679号