Gradle Failed to sync project?

When I started my project this morning, he accidentally gave me a message saying Gradle project sync failed. Basic Functionality(eg. editing, debugging) will not work properly. Gradle project sync failed. Basic Functionality(eg. editing, debugging) will not work properly. in Android Studio. I looked at other answers that people posed to this problem, but they do not work. I canceled my chats / restarted my project, but no luck. I also deleted my .gradle folder from the project folder and still no luck. If any of you guys could help me, that would be awesome! Yesterday this did not happen when I was working on a project or something else, I wonder why this is happening now. Oh yes, it also says this as the message gradle: 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 to everyone who reads this / can help!

+5
source share
7 answers

I had a similar problem with the error with gradle Android project ( in Android Studio 1.1.0 ). I solved this problem without removing .gradle from my user directory, the steps that I followed were

  • Go to File → Settings → Compiler (Gradle Android Project)

  • Change the VM options to -Xmx512m -XX:MaxPermSize=512m .

  • Click Apply → OK, and then touch the Try Again option in the sync error message to clear the project assembly .

Works like a charm !!

UPDATE - 1 . For Android Studio 1.3, the Compiler option mentioned above in Step 1 is present inside the Build, Run, Deploy tab.

+1
source

There is a file - "cache.properties", which gradle creates for you when you first launch any project. The path to this file is "~ Home_Directory \ .gradle \ 2.2.1 \ taskArtifacts". You can find this path in your home directory. Thus, this file - "cache.properties" is not in the "taskArtifacts" folder.

One solution that worked for me is to copy the file - cache.properties from any test project of your project to this project that is currently experiencing a problem.

Hi

+3
source

I had to choose using the default Gradle Wrapper instead of the local one. & L; <SETTINGS → / BUILDING TOOLS → Gradle → switch switch ... →

This helped me solve the same problem.

+2
source

I used to run into a similar problem!

But I do not know, after the restoration of the project and its cleaning, it worked fine.

0
source

Invalid dependency cache by running

 gradle clean build --refresh-dependencies 

from the root of the project, and then re-import the project. Worked for me once.

0
source

You may have installed Android Studio offline. To fix this, go to "Settings" → Gradle and make sure that the "Offline work" checkbox is not selected.

What to do

  • File -> Invalid Caches / Reboot
  • Android Studio shutdown
  • Rename / delete .gradle folder in user's home directory
  • Restart Android Studio lets you download all the necessary Gradle content

android studio 0.4.2: Gradle error with project sync

0
source

Delete the folder C: \ Users \ .gradle and re-opening the Android studio, it solved my problem.

0
source

All Articles