4
votes

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

2
do you have the latest gradle downloaded?Raghunandan
You go to file settings under that you will findle plugins gradle. You can use the local gradle copy instead of the one from your project. Use the latest gradel versionRaghunandan
Let me check this. Actually no. File -> Setting does not existMobile Man
I've added screenshots so people don't just throw these statements around like it's under project->settings or file->settings. No its not.Mobile Man
it is i can also post a screen shot. or you can update your gradel by goto plugins gradle. I am not sure what version of android-studio you are usingRaghunandan

2 Answers

5
votes

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)

6
votes

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.