Gradle error: Minimum supported Gradle version is 3.3. Current version is 3.2

假装没事ソ 提交于 2019-11-26 20:19:07
Ahmed Abd Elgwad

you need to download the latest version from https://gradle.org/releases after that go to file/project structure/project and put the new version in gradle version

Updated Answer: For Android Studio 3.1 & above

For Android Studio 3.1 & above, the distributionUrl has been updated to version 4.6 from version 4.4. Your gradle-wrapper.properties should look like this:

#DATE
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

Updated Answer:

For Android Studio 3.0 & above, the distributionUrl has been updated to version 4.1 from version 3.3. Your gradle-wrapper.properties should look like this:

#DATE
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

Original Answer:

#DATE
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

Make sure you are using default gradle wrapper in Open File > Settings > Build,Execution,Deployment > Build Tools > Gradle.

Open gradle-wrapper.properties

Change the version there on distributionUrl line

In my case, I was missing the setting.gradle file.

Since this is the first result of google this error, I want to remind that simply click the bottom window error message blue link "Fix Gradle wrapper and re-import project Gradle settings" will auto fix for you now.

  • changed distrubutionUrl from 4.1 to 4.4

  • changed build gradle version to 3.1.1 under project/android

works for me.

Evans Tlhako

Open gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

change it to

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

if you have lower version and getting problem importing project with high gradle version and want to run the project without updating gradle than

open your gradle file(Project) and do the small change

  dependencies {
           /*Higher Gradle version*/
//        classpath 'com.android.tools.build:gradle:3.0.0-alpha4'

        /*Add this line and remove the Higher one*/
        classpath 'com.android.tools.build:gradle:2.3.3'
    }

[2.3.3 is stand for your gradle version]

in your case change version to 3.2 or 3.2.0 something like that

Error Message: Gradle sync failed: Minimum supported Gradle version is 4.9. Current version is 4.1-milestone-1. If using the gradle wrapper, try editing the distributionUrl in SampleProj/app/gradle/wrapper/gradle-wrapper.properties to gradle-4.9-all.zip

I am using Android studio IDE version 3.2 beta 2.

Solution: When we open gradle-wrapper.properties file in IDE it shows correct distributionUrl. but originally it has not been updated. So change the distributionUrl property manually.

Example : open a gradle-wrapper.properties file in notepad or any other editor. /Project/app/gradle/wrapper/gradle-wrapper.properties and change distributionUrl property to like this

distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip

About Android Studio Gradle plugin version and Required Gradle version, you can see more detailed answer here: What is real Android Studio Gradle Version?

For each version of this Gradle plugin, it requires a minimum Gradle version as listed on below table

(Reference page:gradle-plugin#updating-gradle).

When you update Android Studio, you may receive a prompt to also update Gradle to the latest available version.

For example, Android Gradle Plugin version 3.1.0+ requires a minimal gradle version 4.4.

You can be configured via Android Studio File -> Project Structure -> Project. See below:

Or you can manually modify the file gradle/wrapper/gradle-wrapper.properties. For example:

distributionUrl = https\://services.gradle.org/distributions/gradle-4.6-all.zip

For Android Studion version 3.3.2

1) I updated the gradle distribution URL to distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip in gradle-wrapper.properties file

2) Within the top-level build.gradle file updated the gradle plugin to version 3.3.2

dependencies {
    classpath 'com.android.tools.build:gradle:3.3.2'
    classpath 'com.google.gms:google-services:4.2.0'
}

I changes only two points

Obviously they were according to the version of the versions that it has, otherwise they would have to download them

  • buil.gradle(Project)

    dependencies {
           classpath 'com.android.toolsg.build:gradle:2.3.2' 
           ..
    }
    
  • gradle.wrapper.properties

    ...
    distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip

Update Android Studio and Gradle. Changing the respective updated gradle version in build.gradle file worked for me.

First of all you need to download the file from here https://gradle.org/releases

unzip the file and copy folder something like this gradle-3.3(if version is 3.3) and past it to C:\Android\Android Studio\gradle

Now open the Android Studio and from the left top corner Open File > Settings > Build,Execution,Deployment > Gradle

Now give the the path of folder gradle-3.3 in Gradle Home

open the gradlew file with android studio, everything will be downloaded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!