Android Gradle plugin says the minimum supported Gradle version is higher than the current one
Minimum 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.
Fix it fast
1Find out which cause you have
Print the Gradle version the project really uses. Compare it with the minimum in the error message.
./gradlew --version2Match what you see, then jump to its fix
- 1
The version after 'Current version is' matches distributionUrl in gradle-wrapper.propertiesThe wrapper still points at an older GradleFix - 2
The error appears with gradle but not with ./gradlew, or the two print different versionsA separately installed gradle command is running, not the wrapperFix - 3
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.The JDK that runs Gradle is too old for the pluginFix
- 1
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.properties2Fix
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.03Verify
The version printed must be at least the minimum named in the error.
./gradlew --versionConfirmed by docs.gradle.org
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 --version2Fix
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 assembleDebug3Verify
Build again with the wrapper and confirm the error is gone.
./gradlew assembleDebugConfirmed by docs.gradle.org
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 -version2Fix
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-173Verify
Run the build again from both the terminal and Android Studio.
./gradlew --versionConfirmed by developer.android.com
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 fixMobile apps
AGP 9 marks the android block as deprecated or fails on BaseExtension
java.lang.ClassCastException: class com.android.build.gradle.internal.dsl.ApplicationExtensionImpl$AgpDecorated_Decorated cannot be cast to class com.android.build.gradle.BaseExtension
AGP 9.0 uses only the new public DSL interfaces.
3 causes, each with a fixMobile apps
The editor cannot find R, so every R.string and R.id turns red
Unresolved reference: R
R is a class that the build generates from your res folder, in the package named by the module's namespace.
4 causes, each with a fixMobile apps
Android Studio says it could not identify the launch activity when you press Run
Run > Edit Configurations > Launch Options is set to Nothing or to a class that no longer exists
Android Studio launches the activity marked with a MAIN action and a LAUNCHER category in the merged manifest.
3 causes, each with a fixMobile apps
Gradle cannot apply the Android application or library plugin
Failed to apply plugin 'com.android.internal.application'.
Gradle loaded the Android Gradle plugin but could not run it.
2 causes, each with a fixMobile apps
FirebaseInstanceIdService and FirebaseInstanceId.getToken() no longer work
Deprecation warning on FirebaseInstanceId.getInstance().getToken()
Move token handling into a class that extends FirebaseMessagingService and override onNewToken, which runs when a token is first created and whenever it changes.
2 causes, each with a fix