How can we use `Kotlin 1.4-M2` when compiling the ...
# eap
g
How can we use
Kotlin 1.4-M2
when compiling the
buildSrc
module classes? I’m using the latest stable Gradle version (6.4) but it looks like it is not enough (Gradle is using 1.3.71). I’m receiving the following error:
Class 'org.jetbrains.kotlin.konan.target.KonanTarget' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
I’ve found a way, I needed to include this:
Copy code
tasks.withType<KotlinCompile> {
	kotlinOptions {
		freeCompilerArgs = listOf("-Xskip-metadata-version-check")
	}
}
🙏 2
🎉 3
❤️ 1
l
@GarouDan Where are you including it?
build.gradle.kts
of
buildSrc
or elsewhere?
g
I didn’t test which one works, but I included in both
buildSrc/build.gradle.kts
and in the
build.gradle.kts
(the root one).
One small correction, I needed to downgrade to
1.4-M1
since
1.4-M2
is not in the EAP repository yet. But the same should work for M2 when it arrives there