Warning “Kotlin plugin version is not the same as library version” (but it is!)

后端 未结 2 671
暗喜
暗喜 2021-01-30 12:15

I have an Android studio project in which I have added a Java library module, which I call core. My three Gradle build files look like this.

project/build

相关标签:
2条回答
  • 2021-01-30 12:48

    Starting from Kotlin 1.4 dependency on the standard library added by default:

    You no longer need to declare a dependency on the stdlib library in any Kotlin Gradle project, including a multiplatform one. The dependency is added by default.

    The automatically added standard library will be the same version of the Kotlin Gradle plugin, since they have the same versioning.

    For platform-specific source sets, the corresponding platform-specific variant of the library is used, while a common standard library is added to the rest. The Kotlin Gradle plugin will select the appropriate JVM standard library depending on the kotlinOptions.jvmTarget compiler option of your Gradle build script.

    0 讨论(0)
  • 2021-01-30 12:57

    This is a bug in the Kotlin plugin. I've filed an issue in the Kotlin issue tracker. You can simply ignore the message.

    EDIT: JetBrains marked the issue as a duplicate of KT-23744 "Kotlin library and Gradle plugin versions are different" inspection false positive for non-JVM dependencies".

    0 讨论(0)
提交回复
热议问题