Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Sync wont finish after 0.4.6 upgrade

After I upgraded my Android Studio to 0.4.6, it seems to get stuck with Gradle Sync. The yellow ribbon is persistently present on the top that says "Gradle Project Synch in Progress". However, there is no indication of any process running from the bar at the bottom.

When I try to run my application, it fails with "Gradle Project Sync Failed. Please fix your project and try again" message that appears in a balloon. However, there are no more information.

I was working on this project successfully before I upgraded to 0.4.6. And since 0.4.6 was updated quickly (within 5 days) from 0.4.5 to fix some gradle related bug, I am starting to wonder if this is something new they introduced.

like image 309
user3259937 Avatar asked Feb 25 '14 14:02

user3259937


People also ask

What does Gradle project sync failed mean?

Android Developers get "Gradle project sync failed" or "Gradle sync failed" error in Android Studio when project gradle is unable to sync properly. This maybe caused due to a number of reasons including incorrent versions in project settings, corrupt cache, network problems and wrong dependencies. Gradle sync fail error happens commonly due to ...

Why is my Gradle not working in Android Studio?

Bad cache in Android Studio: Android Studio makes use of cache in your computer in order to work properly. In some cases, it might get corrupt and cause issues in several modules (including Gradle). Missing files: There might also be missing files which are required to run Gradle.

Why do some plugins break with new Gradle version?

Some plugins will break with this new version of Gradle, for example because they use internal APIs that have been removed or changed. The previous step will help you identify potential problems by issuing deprecation warnings when a plugin does try to use a deprecated part of the API.

What happened to Gradle properties set in the project root Gradle?

There was a regression in Gradle 6.2 and Gradle 6.2.1 that caused Gradle properties set in the project root gradle.properties file to leak into the buildSrc build and any builds included by the root.


1 Answers

I just encountered the same problem this afternoon. I'm running on IntelliJ IDEA, should be similar.

What I did is:

  • remove local Gradle from the $PATH (I used to set GRADLE_HOME variable and it's a different version)
  • in build.gradle, change the classpath to

classpath 'com.android.tools.build:gradle:0.10.+'

  • click File > Invalidate Caches/Restart (you can also manually remove the cache at ~/Library/Caches/{yourIDEName} and restart the IDE)

After this, the "Gradle Project Sync in Progress..." disappear once completed the syncing and I'm able to run my project again.

like image 56
xialin Avatar answered Oct 17 '22 09:10

xialin