Updated from Kotlin 1.6.21 to 1.7.0, I get this ``...
# gradle
r
Updated from Kotlin 1.6.21 to 1.7.0, I get this
Copy code
> Task :buildSrc:compileKotlin
'compileJava' task (current target is 11) and 'compileKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
e: /Users/ribesg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.7.0/4d09852239f61842072b40b524882fa3caaed371/kotlin-compiler-embeddable-1.7.0.jar!/META-INF/backend-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
e: /Users/ribesg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.7.0/4d09852239f61842072b40b524882fa3caaed371/kotlin-compiler-embeddable-1.7.0.jar!/META-INF/backend.common.jvm.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
…
Dependencies of my buildSrc subproject:
Copy code
dependencies {
    compileOnly(gradleKotlinDsl())
    implementation("com.android.tools.build:gradle:$androidGradleVersion")
    implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
    implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlinVersion")
}
What is happening?
e
buildSrc and other things loaded into Gradle's classpath are always run with Gradle's embedded Kotlin
r
Does that mean I should have a version of Kotlin for my code and take the one from Gradle for the JB dependencies I use in my build files?
e
not sure what you mean by that
kotlin-gradle-plugin:1.7.0
works with Gradle's embedded Kotlin version, so you can update that fine
kotlin-compiler-embeddable
should not need to be in the buildscript classpath
r
But not
kotlin-compiler-embeddable
?
e
correct
r
Maybe it’s dead code, let’s see if anything fails if I remove it
Looks like it works. I no longer needed it. Thanks!
n
sorry for the unrelated question but what is difference between those, you know?
Copy code
compileOnly(gradleApi())
compileOnly(gradleKotlinDsl())
compileOnly(localGroovy())
105 Views