Skip to content
Latchkey

Kotlin Gradle plugin incompatible with the Gradle version in CI

Each Kotlin Gradle plugin release supports a specific Gradle range. When the wrapper on the CI runner is outside that range, Gradle refuses to configure the build and names the required version. This is a compatibility mismatch, not a bug in your code.

What this error means

The build fails during configuration with a message like "The applied Kotlin Gradle plugin (version 2.0.21) is incompatible with the current Gradle version" or "Kotlin Gradle plugin ... requires Gradle X or newer".

Gradle
> Configure project :app
The applied Kotlin Gradle plugin (2.0.21) is not compatible with the used Gradle version (7.4).
Please update your Gradle version to 7.6.3 or newer.

Common causes

The Gradle wrapper is older than the plugin needs

A committed gradle-wrapper.properties pins an old Gradle, but the Kotlin plugin version requires a newer one, so CI fails where a locally cached newer Gradle did not.

The plugin was bumped without bumping Gradle

A dependency update raised the Kotlin plugin past what the pinned Gradle supports, leaving the two out of range.

How to fix it

Update the Gradle wrapper to a supported version

  1. Read the required Gradle version from the message.
  2. Run the wrapper task to update gradle-wrapper.properties and commit it.
  3. Ensure CI uses ./gradlew (the wrapper), not a system Gradle.
Terminal
./gradlew wrapper --gradle-version 8.9

Pin a plugin version compatible with your Gradle

If you must stay on an older Gradle, pick a Kotlin plugin release from the compatible range instead of the newest.

build.gradle.kts
plugins {
    kotlin("jvm") version "1.9.25" // compatible with Gradle 7.6+
}

How to prevent it

  • Commit the Gradle wrapper and always invoke ./gradlew in CI.
  • Bump the Gradle wrapper and the Kotlin plugin together, checking the compatibility matrix.
  • Cache the wrapper distribution so the correct Gradle is used every run.

Frequently asked questions

What causes ""Kotlin Gradle plugin ... incompatible ... Gradle""?
A committed gradle-wrapper.properties pins an old Gradle, but the Kotlin plugin version requires a newer one, so CI fails where a locally cached newer Gradle did not.
How do I fix "Kotlin Gradle plugin ... incompatible ... Gradle"?
Update the Gradle wrapper to a supported version

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card