Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 2.2.3: Gradle project sync failed. Basic functionality (e.g. editting, debugging) will not work properly

I needed to preinstall my laptop and switched to Windows 10 . Before that I made and saved my project in Android Studio 2.2.3 and I downloaded the same version of Android Studio after preinstallation, but when I choose Open Existing Project I got the following message:

Failed to sync gradle project 'ApplicationName' Error:Unable to find method 'org.gradle.api.artifacts.Configuration.setExtendsFrom(Ljava/lang/Iterable;)Lorg/gradle/api/artifacts/Configuration;'.

Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project. Blockquote

I did all the three steps suggested by Android Studio to fix my project, but none of them worked.

like image 515
Victoria Avatar asked Feb 12 '17 17:02

Victoria


2 Answers

Your gradle version is: 1.8 which is not working anymore so you probably have to update it:

1- Go to -> https://gradle.org/install check out the latest verion number.

2- In your project directory navigate to \gradle\wrapper\ directory and edit: gradle-wrapper.properties file.

change:

https://services.gradle.org/distributions/gradle-1.8-all.zip

to:

https://services.gradle.org/distributions/gradle-3.3-all.zip

3- go to Tools→Android→Sync Project with Gradle files

4- If sync doesn't do the job restart Android studio

like image 169
Ahmad Sanie Avatar answered Sep 28 '22 19:09

Ahmad Sanie


Just go to file -> Invalidate Caches/Restart -> Invalidate and Restart

like image 29
Bilal Ahmad Avatar answered Sep 28 '22 19:09

Bilal Ahmad