警告:classpath中的Kotlin运行时JAR文件应具有相同的版本 [英] warning: Kotlin runtime JAR files in the classpath should have the same version

查看:3209
本文介绍了警告:classpath中的Kotlin运行时JAR文件应具有相同的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下警告,但不确定v1.0.6的位置.

I get the following warning, but I'm not sure where v1.0.6 resides.

此错误是否有可能来自Kotlin库,包括旧的Kotlin版本?

Is it possible this error comes from a Kotlin library somehow including an old Kotlin version?

关于如何解决它的任何想法,或者至少我该如何遵循使Kotlin-reflect明确(1.1)的建议?

Any ideas how to fix it or at least how can I follow the suggestion to make kotlin-reflect explicit (1.1) ?

推荐答案

似乎您的项目是以依赖kotlin-stdlib 1.1和kotlin-reflect 1.0的方式配置的.最可能的情况是您已经明确依赖kotlin-stdlib 1.1,但是没有依赖kotlin-reflect,而某些其他库(依赖)依赖于kotlin-reflect 1.0.

It seems that your project is configured in such a way that you depend on kotlin-stdlib 1.1 and kotlin-reflect 1.0. The most likely case is that you already have an explicit dependency on kotlin-stdlib 1.1 but have no dependency on kotlin-reflect, and some other library (which you depend on) depends on kotlin-reflect 1.0.

如果确实如此,解决方案是提供对kotlin-reflect 1.1的显式依赖.

If that indeed is the case, the solution is to provide an explicit dependency on kotlin-reflect 1.1.

在Maven中,将其添加到pom.xml:

In Maven, add this to pom.xml:

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>1.1.0</version>
        </dependency>
    </dependencies>

在Gradle中,将其添加到build.gradle:

In Gradle, add this to build.gradle:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-reflect:1.1.0"
}

在官方文档中查看有关此警告和相关警告的一些信息.

这篇关于警告:classpath中的Kotlin运行时JAR文件应具有相同的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆