Skip to content
Latchkey

Gradle "plugin already on the classpath must not include a version" in CI

Gradle loads a plugin once for the build classpath. When a subproject requests that same plugin with an explicit version while the root project already put it on the classpath, the request is invalid and the build fails before configuration completes.

What this error means

The build fails with "Error resolving plugin [id: 'X', version: 'Y']" and "The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so the request must not include a version number."

Gradle
> Error resolving plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.9.22']
  > The request for this plugin could not be satisfied because the plugin is
    already on the classpath with an unknown version, so the request must not
    include a version number.

Common causes

A subproject repeats the version of a root-applied plugin

The root build (or a convention plugin) already applied the plugin, so a subproject plugins {} block must apply it without a version.

The plugin sits on the buildscript classpath

The plugin was added via buildscript { dependencies }, giving it an unknown version on the classpath, which forbids a versioned request.

How to fix it

Apply the plugin without a version in subprojects

  1. Declare the version once, at the root or in plugins {} with apply false.
  2. In each subproject, request the plugin id with no version.
  3. Re-run the build so the single classpath version is reused.
build.gradle.kts
// settings.gradle.kts or root build.gradle.kts
plugins { id("org.jetbrains.kotlin.jvm") version "1.9.22" apply false }

// subproject build.gradle.kts
plugins { id("org.jetbrains.kotlin.jvm") }

Centralize plugin versions

Define plugin versions in one place (the root or a version catalog) so subprojects never restate them.

gradle/libs.versions.toml
[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "1.9.22" }

How to prevent it

  • Declare plugin versions once and apply them without a version downstream.
  • Use apply false at the root for plugins applied in subprojects.
  • Prefer a version catalog so plugin versions are not duplicated.

Frequently asked questions

What causes ""already on the classpath must not include a version""?
The root build (or a convention plugin) already applied the plugin, so a subproject plugins {} block must apply it without a version.
How do I fix "already on the classpath must not include a version"?
Apply the plugin without a version in subprojects

Related guides

References

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