'Android studio 2.1.1 gradle project sync failed
I just installed android studio 2.1.1. And when I'm opening a old project I'm getting this error-
Platform and Plugin Updates: The following components are ready to update: Android Support Repository, Google Repository, Google APIs Intel x86 Atom System Image, Android SDK Tools 25.1.7 8:18:58 AM Gradle sync started 8:19:39 AM Gradle sync failed: Could not find com.android.tools.build:gradle:2.2.1. Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.jar https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.jar
Please help. I'm beginner here...
Solution 1:[1]
Try this,
Download the files from the links provided i.e
https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom
And
https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.jar
Then paste this files in their appropriate places i.e
C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.1/
Goodluck :)
Solution 2:[2]
The minimum gradle version supported by Android Studio 2.1.1 (which here refers to android plugin 2.1.0) is 2.10.
In your gradle-wrapper.properties file in your project update the gradle version to 2.10, by editing the distributionUrl filed
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
The lastest version as of now is 2.13 , you can also update to that.
NOTE : This will update gradle used by your project, to change the gradle used by Android Studio , change the gradle version in settings.
Reference : Official Docs
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Twahanz |
| Solution 2 | Nishant Srivastava |
