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".
> 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
- Read the required Gradle version from the message.
- Run the wrapper task to update
gradle-wrapper.propertiesand commit it. - Ensure CI uses
./gradlew(the wrapper), not a system Gradle.
./gradlew wrapper --gradle-version 8.9Pin 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.
plugins {
kotlin("jvm") version "1.9.25" // compatible with Gradle 7.6+
}How to prevent it
- Commit the Gradle wrapper and always invoke
./gradlewin 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.