0

I'm attempting to update my gradle version within Android Studio. I am attempting to use version 2.10, but am running into issues.

Within my gradle-wrappers.properties I have

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

Inside my build.gradle file for my project I have

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.10' } } allprojects { repositories { jcenter() } } 

Within my Android Studio preferences, I do have Use default gradle wrapper selected. The errors I'm getting

4:04:01 PM Gradle sync failed: Could not find com.android.tools.build:gradle:2.10. Searched in the following locations: file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/2.10/gradle-2.10.pom file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/2.10/gradle-2.10.jar https://jcenter.bintray.com/com/android/tools/build/gradle/2.10/gradle-2.10.pom https://jcenter.bintray.com/com/android/tools/build/gradle/2.10/gradle-2.10.jar Required by: :MyApp:unspecified Consult IDE log for more details (Help | Show Log) 

I can see it's trying to find two files: gradle-2.10.pom and gradle-2.10.jar. Am I supposed to install those files manually?

2 Answers 2

2

Don't confuse the gradle plugin for android with the gradle version.

With this line you are declaring the gradle plugin. Use

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

The gradle version is defined in gradle/wrapper/gradle-wrapper.properties. Use:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 
Sign up to request clarification or add additional context in comments.

Comments

1

To update the gradle wrapper you don't need to change the version of Android Plugin for Gradle.

The last version of com.android.tools.build:gradle is 2.0.0. Change your build.gradle like this:

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.0.0' } } allprojects { repositories { jcenter() } } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.