31

After update to Android Studio Chimpmunk, I get the error message on Gradle sync:

Minimum supported Gradle version is 7.3.3. Current version is 7.2.'

In my gradle-wrapper.properties, I have got :

distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip

In my build.gradle, I have :

classpath 'com.android.tools.build:gradle:7.2.0'

I can't change it to:

classpath 'com.android.tools.build:gradle:7.3.3'

the latest version being found by Android Studio being 7.2.0

If I set:

distributionUrl=https\://services.gradle.org/distributions/gradle-7.2.0-bin.zip

I also get the same error (stangely).

I to fix this problem?

Thanks.

ANSWER TO MY QUESTION :

For now, I downgraded both to 7.0.4. Update will probably be possible soon.

toto_tata
  • 14,526
  • 27
  • 108
  • 198
  • Are you using the wrapper? What's in your Studio preferences -> build, execution, deployment -> build tools -> gradle? – laalto May 17 '22 at 08:55
  • Not exactly sure, but I think `7.4.2` is the required version, despite the error message tells otherwise. https://developer.android.com/studio/releases/gradle-plugin#updating-gradle – Martin Zeitler May 17 '22 at 09:05
  • Check this https://stackoverflow.com/a/73034758/5040556 – Daniele Jul 19 '22 at 09:49
  • 1
    the `dependencies` `classpath 'com.android.tools.build:gradle:7.2.0'` affect the gradle version needed. Downgrading it to `classpath 'com.android.tools.build:gradle:7.0.4'` works! – Jiaheng Tao Oct 12 '22 at 08:44

12 Answers12

49

I just had this problem and invalidating cache fixed the issue.

Image: Invalidate Cache and restart

mortalis
  • 2,060
  • 24
  • 34
Khaled
  • 1,343
  • 1
  • 6
  • 10
  • 1
    Nice. This is also works for error 'Minimum supported Gradle version is 7.4. Current version is 7.3.3.' – Ahmad Arif Faizin Oct 18 '22 at 04:15
  • Thanks. After setting the exact location for the newest gradle on the PC and syncing the project it was still giving the same problem. But invalidating cache is the last step in the solution. – mortalis Apr 11 '23 at 17:21
9

file/sync project with Gradle Files

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 24 '22 at 04:18
5

I got this problem too after accepting an auto-update prompt from Android Studio. Weirdly, my machine synced OK but other people's didn't.

The gradle version requirement seems to be imposed by the Android gradle plugin (AGP) versions. So also look in your build.gradle files for this kind of thing:

plugins {
    id 'com.android.application' version '7.2.0'
    id 'com.android.library' version '7.2.0'
}

I found that the AGP version had got bumped to 7.2.0 by the update, and that must have a requirement of Gradle 7.3.3 (confusing!). Anyway, when I edited the AGP back to 7.1.3, then I could downgrade the base gradle distributionUrl to 7.2 and it all worked again.

So this is a compatible set of versions:

build.gradle

plugins {
    id 'com.android.application' version '7.1.3'
    id 'com.android.library' version '7.1.3'
}

gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
Ben
  • 1,881
  • 17
  • 20
3

I have invalidated cache but it didnt help.

The problem of my setup was a two gradle-wrapper.properties files. Both of them should have same Gradle version but they had different.

yourproject/gradle/wrapper/gradle-wrapper.properties

and

gradle/wrapper/gradle-wrapper.properties

I set the same Gradle version for both of them to the

distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip

After that issue has gone.

Anatolii Shuba
  • 4,614
  • 1
  • 16
  • 17
3

I had the same problem for a project that i havent opened since december 2021, i fixed it by updating the gradle version to 7.4.2 in gradle.wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip

and used 7.2.1 for the android gradle plugin version, i've also updated Android Studio to Chipmunk 2021.2.1 Patch 1.

Badr At
  • 658
  • 7
  • 22
2

I had this issue with a Cordova Android project. Just go to File > Project Structure > Project (Android Studio Flamingo). Select a version of Gradle that works for you (drop down menu). Click Apply and the project should build now.

Arnaud Leyder
  • 6,674
  • 5
  • 31
  • 43
1

I faced the same issue for Gradle version 7.3.0 (Stable). This is how I solved the issue:

  1. I changed the distribution URL present inside gradle-wrapper.properties file:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
  1. Then removed the following plugin present inside the build.gradle (app module)
apply plugin: 'com.google.gms.google-services'
  1. Finally added this line to the main/AndroidManifest.xml to the activity section:
android:exported="true" 
Abhishek Dutt
  • 1,308
  • 7
  • 14
  • 24
MSI Shamim
  • 11
  • 3
1

You have to update to android studio dolphin first (was on chipmunk). This update support gradle version : 3.2 to 7.3, link here https://developer.android.com/studio/releases/gradle-plugin

Then update gradle-wrapper.properties :

distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip

Then update your module dependencies as below

dependencies {
    classpath 'com.android.tools.build:gradle:7.3.0'
}

Optional : You will be asked to update gradle plugin to 7.3.1 so you can do it then your will have -> 'com.android.tools.build:gradle:7.3.1'

That's all you need, no invalidate cache and restart or something else.

Zhar
  • 3,330
  • 2
  • 24
  • 25
0

So I've just had the same problem with the incompatible required and current Gradle versions(followed the suggested AGP update). Going back to v7.0.4 has fixed the issue.

However, the answer given by @Khaled has also worked for me.

File > Invalidate Caches > Invalidate and Restart

Semerkosa
  • 16
  • 5
0

Install new version Android Studio. It's working for me.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 06 '23 at 13:03
0

I have had similar issue when i had to update the iDE from chipmunk to flamingo, had faced AGP compatability issues, for that after some reading i found the following one useful in my case enter image description here where we can make this change in project level gradle

0

Please try the following :

1.- Open AndroidStudio

2.- Click on File -> Project Structure

3.- Set up the Gradle Version

4.- Clic on Apply and then Ok

Screenshot Project Structure for gradle version

I will hope it help

Greetings from México

samaniego
  • 169
  • 2
  • 9