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.
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
Just go to file -> Invalidate Caches/Restart -> Invalidate and Restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With