Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle project sync failed?

When I started up my project this morning it randomly gave me a message saying Gradle project sync failed. Basic Functionality(eg. editing, debugging) will not work properly. in Android Studio. I looked at other answers that people had put up for this problem but they haven't been working. I invalidated my chaches/restarted my project but no luck. I also deleted my .gradle folder from my project folder and still no luck. If any of you guys could help me that would be awesome! This didn't happen yesterday when I was working on the project or anything, I wonder why its happening now. Oh yea it also says this as a gradle message: Error:C:\Users\Dave\.gradle\caches\2.2.1\scripts\settings_ad4t0wp5ikihzl1y1o83b5sbw\SettingsScript\buildscript\cache.properties (The system cannot find the file specified) :

Thanks again for anyone who reads this/ can help!

like image 982
Dashboarrd Avatar asked Apr 05 '15 16:04

Dashboarrd


People also ask

How do I sync a project with Gradle?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.


2 Answers

There is a file - "cache.properties" that gradle creates for you, upon first time inception of any project. The path for this file is "~Home_Directory\.gradle\2.2.1\taskArtifacts". You may find this path in your home directory. So basically, this file - "cache.properties" is missing from the "taskArtifacts" folder.

One of the solution that worked for me is to copy file - "cache.properties" from any test project of yours to this project that's currently experiencing an issue.

Regards

like image 50
Hamit Avatar answered Oct 11 '22 05:10

Hamit


I had to choose using the Default Gradle Wrapper instead of local. << SETTINGS -->/ BUILD TOOLS --> Gradle --> radio button switch... >>

It has helped me to fix the same problem.

like image 31
Pavel Gluzman Avatar answered Oct 11 '22 05:10

Pavel Gluzman