GoogleContainerTools/jib · error · GradleException

Jib plugin version is %s but is required to be %s

Error message

Jib plugin version is %s but is required to be %s

What it means

checkJibVersion compares the actual Jib plugin version against the required version given by the `jib.requiredVersion` system property. If VersionChecker says the installed plugin version is not compatible with the required one, apply() throws this GradleException with a formatted message naming both versions.

Source

Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/JibPlugin.java:85

  }

  /** Check the Jib version matches the required version (if specified). */
  private static void checkJibVersion() {
    // todo: should retrieve from project properties?
    String requiredVersion = System.getProperty(REQUIRED_VERSION_PROPERTY_NAME);
    if (requiredVersion == null) {
      return;
    }
    String actualVersion = GradleProjectProperties.TOOL_VERSION;
    if (actualVersion == null) {
      throw new GradleException("Could not determine Jib plugin version");
    }
    VersionChecker<GradleVersion> checker = new VersionChecker<>(GradleVersion::version);
    if (!checker.compatibleVersion(requiredVersion, actualVersion)) {
      String failure =
          String.format(
              "Jib plugin version is %s but is required to be %s", actualVersion, requiredVersion);
      throw new GradleException(failure);
    }
  }

  @Override
  public void apply(Project project) {
    checkGradleVersion();
    checkJibVersion();

    JibExtension jibExtension =
        project.getExtensions().create(JIB_EXTENSION_NAME, JibExtension.class, project);

    TaskContainer tasks = project.getTasks();
    TaskProvider<BuildImageTask> buildImageTask =
        tasks.register(
            BUILD_IMAGE_TASK_NAME,
            BuildImageTask.class,
            task -> {
              task.setGroup("Jib");

View on GitHub (pinned to fb949e2676)

Solutions

  1. Align the Jib plugin version in build.gradle/plugins block with the value expected by jib.requiredVersion
  2. Update jib.requiredVersion (Skaffold config / gradle.properties / -D flag) to match the installed plugin version
  3. Upgrade Skaffold so its injected jib.requiredVersion matches your plugin version
  4. Remove jib.requiredVersion if the Skaffold compatibility pin is no longer needed

Example fix

// before
plugins { id 'com.google.cloud.tools.jib' version '3.4.0' }
// run with: -Djib.requiredVersion=1.8.0
// after
plugins { id 'com.google.cloud.tools.jib' version '1.8.0' } // matches jib.requiredVersion
// or run without the stale pin: remove -Djib.requiredVersion=1.8.0
Defensive patterns

Strategy: validation

Validate before calling

def required = System.getProperty('jib.requiredVersion')
def actual = GradleProjectProperties.TOOL_VERSION
if (required && actual && !required.startsWith(actual.split('\\.').take(2).join('.'))) {
  logger.warn("jib.requiredVersion=${required} may not match plugin ${actual}")
}

Try / catch

try {
  jib.build()
} catch (GradleException e) {
  if (e.message.startsWith('Jib plugin version is')) {
    logger.error('Align plugin version with jib.requiredVersion: ' + e.message)
  } else { throw e }
}

Prevention

When it happens

Trigger: Running a build (often via Skaffold) with -Djib.requiredVersion=X while the applied com.google.cloud.tools.jib plugin version differs from what X requires (checker.compatibleVersion returns false); e.g. requiredVersion=1.8.0 with Jib 3.x installed.

Common situations: Skaffold pinning an old jib.requiredVersion after the project upgraded the Jib plugin (or vice versa); CI configured with a stale jib.requiredVersion; multiple teams with mismatched plugin versions and a strict requiredVersion in CI scripts.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/f7f6449d42536582. Report an issue: GitHub.