Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Android Gradle plugin says the minimum supported Gradle version is higher than the current one

ErrorMinimum supported Gradle version is X. Current version is Y.

Short answer

The Android Gradle plugin (AGP) needs a minimum Gradle version, and your build runs an older one. Upgrade the Gradle wrapper to at least the version the error names, or lower AGP. Run ./gradlew --version afterwards, and always build with the wrapper, not a separately installed Gradle.

  • Applies to Android Gradle Plugin 9.5, Gradle 9.6, JDK 17
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the Gradle version the project really uses. Compare it with the minimum in the error message.

    ./gradlew --version
  2. 2Match what you see, then jump to its fix

    1. 1The version after 'Current version is' matches distributionUrl in gradle-wrapper.propertiesThe wrapper still points at an older GradleFix
    2. 2The error appears with gradle but not with ./gradlew, or the two print different versionsA separately installed gradle command is running, not the wrapperFix
    3. 3Android Gradle plugin requires Java 17 to run. You are currently using Java 11.The JDK that runs Gradle is too old for the pluginFix

What does the error look like?

  • Minimum supported Gradle version is X. Current version is Y.
  • Android Gradle plugin requires Java 17 to run.

Cause 1 of 3

The wrapper still points at an older Gradle

1Check

Read the version in the wrapper file. The AGP release notes give the minimum Gradle for each plugin version (AGP 9.5 needs 9.6.0).

grep distributionUrl gradle/wrapper/gradle-wrapper.properties

2Fix

Run the wrapper task with the target version. It often needs a second run so the wrapper jar and scripts update too. Gradle 9 and newer need the full X.Y.Z form.

./gradlew :wrapper --gradle-version 9.6.0
./gradlew :wrapper --gradle-version 9.6.0

3Verify

The version printed must be at least the minimum named in the error.

./gradlew --version

Confirmed by docs.gradle.org

Did this fix it?

Cause 2 of 3

A separately installed gradle command is running, not the wrapper

1Check

Compare the two commands. The wrapper pins one Gradle per project; a system-wide install does not.

gradle --version
./gradlew --version

2Fix

Build with ./gradlew (gradlew.bat on Windows). Then nobody needs to install Gradle by hand, and CI uses the same version as your machine.

./gradlew assembleDebug

3Verify

Build again with the wrapper and confirm the error is gone.

./gradlew assembleDebug

Confirmed by docs.gradle.org

Did this fix it?

Cause 3 of 3

The JDK that runs Gradle is too old for the plugin

1Check

From a terminal, JAVA_HOME decides which JDK runs Gradle. From Android Studio's buttons, the Gradle JDK setting does.

echo $JAVA_HOME
java -version

2Fix

Point JAVA_HOME and the Gradle JDK setting in Android Studio (Settings, Build Tools, Gradle) at the same JDK 17 or newer.

export JAVA_HOME=/path/to/jdk-17

3Verify

Run the build again from both the terminal and Android Studio.

./gradlew --version

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Upgrade AGP and the wrapper in the same commit, and check the compatibility table in the AGP release notes first.
  • Commit gradle/wrapper/gradle-wrapper.properties so every machine uses one version.
  • Set JAVA_HOME and the Android Studio Gradle JDK to the same JDK.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Android app crashes because the Apache HTTP classes are missing

java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;

From Android 9 the Apache HTTP client is no longer on the default classpath, so code or a library that still uses org.apache.http fails at runtime.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.