Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: Gradle version 2.2 is required. Current version is 5.1.1

build.gradle is as below

   dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

Error is as below:

ERROR: Gradle version 2.2 is required. Current version is 5.1.1.

Please fix the project's Gradle settings. Fix Gradle wrapper and re-import project Open Gradle wrapper properties Gradle settings

like image 872
Zahid Hussain Avatar asked Dec 14 '22 11:12

Zahid Hussain


2 Answers

The android gradle plugin and the gradle version are linked. Here you can find all info:

Plugin version  Required Gradle version
1.0.0 - 1.1.3   2.2.1 - 2.3
1.2.0 - 1.3.1   2.2.1 - 2.9
1.5.0           2.2.1 - 2.13
2.0.0 - 2.1.2   2.10 - 2.13
2.1.3 - 2.2.3   2.14.1+
2.3.0+          3.3+
3.0.0+          4.1+
3.1.0+          4.4+
3.2.0 - 3.2.1   4.6+
3.3.0 - 3.3.2   4.10.1+
3.4.0+          5.1.1+

Use in your build.gradle

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

and in the gradle-wrapper.properties file

distributionUrl = https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
like image 170
Gabriele Mariotti Avatar answered May 21 '23 12:05

Gabriele Mariotti


You can try to change the gradle plugin version in your project level build.gradle file to 2.2.0:

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

and then Invalidate and Restart Android studio.

like image 24
bart Avatar answered May 21 '23 11:05

bart