简体   繁体   中英

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...

Try this,

Download the files from the links provided ie

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 ie

C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.1/

Goodluck :)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM