Kotlin "incompatible Kotlin/Gradle plugin version" in CI
A library on the classpath was compiled with a newer Kotlin than the compiler your build runs. The metadata versions do not match, so the build cannot read the module reliably and fails.
What this error means
The build fails with "e: ... Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is X.Y.Z, expected version is A.B.C".
e: /home/runner/.gradle/.../lib.jar!/META-INF/lib.kotlin_module:
Module was compiled with an incompatible version of Kotlin.
The binary version of its metadata is 2.0.0, expected version is 1.9.0.Common causes
The Kotlin Gradle plugin is older than a dependency
A dependency built with a newer Kotlin carries metadata the older Kotlin Gradle plugin in your build cannot read.
Mismatched Kotlin versions across modules
Subprojects or the stdlib resolve to different Kotlin versions, producing incompatible metadata on one classpath.
How to fix it
Align the Kotlin plugin version
- Read the expected and found metadata versions in the error.
- Raise the Kotlin Gradle plugin to match or exceed the dependency.
- Re-run so the compiler can read the newer metadata.
plugins {
kotlin("jvm") version "2.0.0"
}Pin one Kotlin version across modules
Constrain the stdlib and plugin to a single version so every module emits compatible metadata.
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0"))
}How to prevent it
- Keep the Kotlin Gradle plugin at least as new as your dependencies.
- Use the Kotlin BOM to pin one version across modules.
- Upgrade Kotlin and dependencies together.