Android studio 0.4.2: Gradle project sync failed error

Android studio 0.4.2: Gradle project sync failed error


Solution 1:
File -> Invalidate caches / Restart
Shutdown Android Studio
Rename/remove .gradle folder in the user home directory
Restart Android Studio let it download all the Gradle stuff it needs
Gradle build success !
Rebuild project.... success !
Out of curiousity I compared the structure of the old .gradle and the new one... they were pretty different !

So I'll see how 0.4.2 goes :)
Solution 2:
I had same problem but finally I could solve it forever
Steps:
  1. Delete gradle and .gradle folders from your project folder.
  2. In Android Studio: Open your project then: File -> settings -> compiler -> gradle: enable offline mode
    Note: In relatively newer Android Studios, Offline mode has been moved to gradle setting. enter image description here
  3. Close your project: File -> close project
  4. Connect to the Internet and open your project again then let Android Studio downloads what it wants
If success then :)
else
  1. If you encounter gradle project sync failed again please follow these steps:
  2. Download the latest gradle package from this directory
  3. Extract it and put it somewhere (for example f:\gradle-1.10)
  4. Go to your Android Studio and load your project then open File->Settings->gradle, in this page click on Use local gradle distribution
  5. Type your gradle folder address there
    enter image description here
Congratulation you are done!
Android studio 0.4.2: Gradle project sync failed error Android studio 0.4.2: Gradle project sync failed error Reviewed by Anonymous on June 28, 2017 Rating: 5

No comments:

Java Ternary Operator

Java Ternary Operator Java ternary operator is the only conditional operator that takes three operands. Java ternary operator is a one l...

Powered by Blogger.