Nathan Tamez
08/21/2023, 1:49 PMimplementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.21")
in out common main and have this set in our kotlin.stdlib.default.dependency=false
gradle.properties file but we still get this error /Users/ntamez/git/NatoNathan/math-kmp/build/.transforms/7d524b6b24a9d3827991c9c6de7b0371/transformed/out/jars/classes.jar!/META-INF/math-kmp_debug.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
we are using 1.9 kotlin plugin and have the languageVersion
and apiVersion
set to 1.7 via compilerOptions
Nathan Tamez
08/21/2023, 1:52 PMNathan Tamez
08/21/2023, 1:53 PMspand
08/21/2023, 1:54 PMtasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
progressiveMode.set(true)
}
}
Not really an expert but this sticks out. Is this on purpose?Nathan Tamez
08/21/2023, 2:00 PMNathan Tamez
08/21/2023, 2:02 PMimplementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.21")
should force the use of the older stdlib according to the docs,Nathan Tamez
08/21/2023, 2:03 PMIf you declare a standard library dependency explicitly (for example, if you need a different version), the Kotlin Gradle plugin won’t override it or add a second standard library.https://kotlinlang.org/docs/gradle-configure-project.html#dependency-on-the-standard-library
mbonnin
08/21/2023, 2:08 PMbut simply settingThis will depend onshould force the use of the older stdlib according to the docsimplementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.21")
kotlin-stdlib:1.7.21
but your own classes will still contain 1.9 Kotlin metadatambonnin
08/21/2023, 2:10 PMn-1
to understand metadata produced by n
(on the JVM)Nathan Tamez
08/21/2023, 2:15 PMtasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_7)
languageVersion.set(KotlinVersion.KOTLIN_1_7)
progressiveMode.set(true)
}
}
Nathan Tamez
08/21/2023, 2:17 PM/Users/ntamez/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-junit/1.9.0/f106f1676ea59098e42e209709064c6e45b2913e/kotlin-test-junit-1.9.0.jar!/META-INF/kotlin-test-junit.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
do i need to explicitly version implementation(kotlin("test"))
?mbonnin
08/21/2023, 2:18 PMNathan Tamez
08/21/2023, 2:18 PM