Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
712 views
in Technique[技术] by (71.8m points)

warning: Kotlin runtime JAR files in the classpath should have the same version

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

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

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

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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

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>

In Gradle, add this to build.gradle:

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

See some info about this and related warnings in the official docs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...