The error names two versions. The first is what you need, the second is what you have. This is from a new Flutter 3.50.1 project set back to Gradle 9.3.1:
* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 9.5.0. Current version is 9.3.1.
Try updating the 'distributionUrl' property in .../android/gradle/wrapper/gradle-wrapper.properties to 'gradle-9.5.0-bin.zip'.
Your numbers may differ. Use the ones in your build output.
Fix: change distributionUrl
Open android/gradle/wrapper/gradle-wrapper.properties and edit the last part of the distributionUrl line:
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-all.zip
Then rebuild. The -all and -bin files both work. The wrapper downloads the new version on the first run, so that build takes longer.
flutter clean
flutter run
Edit the file in your Flutter project. Installing Gradle on your computer changes nothing, because the build uses the version the wrapper names.
Which Gradle version does your AGP need?
The Android Gradle Plugin (AGP) version is in android/settings.gradle(.kts), on the com.android.application line. Older projects have it in android/build.gradle as com.android.tools.build:gradle.
| Android Gradle Plugin | Minimum Gradle |
|---|---|
| 9.4, 9.5 | 9.6.0 |
| 9.3 | 9.5.0 |
| 9.2 | 9.4.1 |
| 9.1 | 9.3.1 |
| 9.0 | 9.1.0 |
| 8.11 to 8.13 | 8.13 |
| 8.9, 8.10 | 8.11.1 |
| 8.8 | 8.10.2 |
| 8.7 | 8.9 |
| 8.5, 8.6 | 8.7 |
| 8.4 | 8.6 |
| 8.3 | 8.4 |
| 8.2 | 8.2 |
| 8.0, 8.1 | 8.0 |
Paste your three Gradle files into the Gradle and target API checker to see which lines to change.
Flutter has its own minimum
Flutter 3.50 stops the build below Gradle 9.3.1, whatever your AGP needs, with a different message:
Error: Your project's Gradle version (8.9.0) is lower than Flutter's minimum supported version of 9.3.1.
It also needs AGP 9.1.1 or newer and Java 17, and it warns below Gradle 9.5.0 and AGP 9.3.1. If you are upgrading, change them together: see the Flutter 3.50 upgrade guide or run the upgrade checker.
If the build fails again
- “Unsupported class file major version” means the Gradle version is too old for your Java version. See the Java and Gradle table.
- Kotlin plugin errors after the upgrade are covered in the newer Kotlin Gradle plugin fix and, for AGP 9, built-in Kotlin.
Frequently asked questions
Where do I change the Gradle version in a Flutter project?
In android/gradle/wrapper/gradle-wrapper.properties, on the distributionUrl line. Change the version number in the zip file name and rebuild.
Should I upgrade Gradle or downgrade the Android Gradle Plugin?
Upgrade Gradle. A lower AGP can fall below what your packages or your Flutter version require, which leads to a new error.
What is the difference between Gradle and the Android Gradle Plugin?
Gradle is the build tool, set in gradle-wrapper.properties. The Android Gradle Plugin adds Android building to it and is set in settings.gradle or build.gradle. Each plugin version needs a minimum Gradle version.
Stuck on a build or a store release? I fix and maintain Flutter apps, or tell me about your project. More fixes: all Flutter answers.