This message was deleted.
# community-support
s
This message was deleted.
a
Does this also happen if you target 1.7?
It's also possible the gradle daemon is using a cached build.
gradlew --stop
then remove all your build directories
r
Thanks for your reply. Ive run
./gradlew --stop
-> clean -> build. No luck. same error message
v
Maybe if you do a
./gradlew clean
?
r
Still no luck
a
I would try deleting your
build
directories, maybe there's something that clean isn't getting.
v
Or maybe you use some libraries that require Kotlin 1.8 also in your main branch now? What is the whole error message, doesn't it tell who / what exactly is the problem?
r
I should mention that i also recloned the repo and still getting the same message
v
Maybe if you wipe out the caches in
<GRADLE_USER_HOME>
? Everything that is not put manually there like
gradle.properties
or init scripts.
r
that the full message:
Copy code
e: /Users/roi/Git/project/src/test/kotlin/MyClass.kt: (155, 56): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
The class is loaded from /Users/roi/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.0/1796921c7a3e2e2665a83e6c8d33399336cd39bc/kotlin-stdlib-1.8.0.jar!/kotlin/Unit.class
that one of them... i have a few
v
Oh, ok, that's the Kotlin stdlib, not your classes. Do you get that when compiling through Gradle or when compiling through IDE?
Somehow you compile against Kotlin 1.8 stdlib while trying to compile with / for 1.6
r
Im running the build task in the intellij gradle bar
v
Well, you need to find out why kotlin-stdlib makes it into your compile classpath. Something like
./gradlew dependencyInsight --configuration testCompileClasspath --dependency org.jetbrains.kotlin:kotlin-stdlib
should probably help
r
this is what i get when i do that:
Copy code
FAILURE: Build failed with an exception.

* What went wrong:
Configuration 'testCompileClasspath' not found in configuration container.
v
Is it a multi-project build? Call the
dependencyInsight
task on the project where the problem is
r
thanks! the insight did reveal from where the dependency comes from. Deleting the maven local did the trick.
v
Yeah, Maven Local is a broken-by-design crap and should be avoided as hell 😄
r
Noted. Thanks again
👌 1