Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 1.1 Gradle 2.2.1 Gradle version 2.1 required current version is 2.2.1

I am just trying to compile the latest version of u2020-daggr2 in Android stu![e I imported it as a gradle project. But I get error complaining about gradle! I did edit the gradle-wrapper.properties. Rebuilding however did not work. I did see: Gradle 2.1 is required Migrate to Gradle wrapper and sync project which seems like same issue but on Studio I did not find:

Settings -> Gradle and click Use default gradle wrapper (recommended).

I did not find where to do this in Studio. First off there is no menu that just says Setting. There is : File->Other Setting->Default Setting. But nothing but gradle vm parameters etc. Nothing about using default gradle wrapper. enter image description here Do I need to have a local copy of gradle 2.1 for this to work? enter image description here ![enter image description here][4] enter image description here

gradle wrapper.properties is edited as such: distributionUrl=https://services.gradle.org/distributions/gradle-2.1-all.zip

Error:(20) A problem occurred evaluating root project 'u2020-dagger2'.

Failed to apply plugin [id 'com.android.application'] Gradle version 2.1 is required. Current version is 2.2.1. If using the gradlewrapper, try editing the distributionUrl in /Users/Mac1/Downloads/u2020-dagger2 /gradle/wrapper/gradle-wrapper.properties to gradle-2.1-all.zip

like image 791
Mobile Man Avatar asked Dec 19 '22 05:12

Mobile Man


2 Answers

click on your build.gradle file in project explorer and make changes as

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

ReBuild your project! Hope this helps.

like image 150
silent_programmer Avatar answered Dec 30 '22 12:12

silent_programmer


You have to use this gradle-plugin in your build.gradle

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

Android Studio 1.1.0 requires:

  • Gradle 2.2.1 (you can set this value in the gradle-wrapper.properties)

  • Gradle plugin 1.0.0/1.1.0 (you can set this value in your build.gradle)

like image 31
Gabriele Mariotti Avatar answered Dec 30 '22 11:12

Gabriele Mariotti