5

I can not build any android project in Android Studio. Recently Android studio was updated to 2.3 as well as the gradle version. I think somewhere the update has messed up I am not sure where it is. I have deleted .gradle directory from the home folder several times by now. Changed the distributionUrl to older version of gradle. But the problem persists. Where to look at what is going on? How to solve this issue?

salmanwahed
  • 9,450
  • 7
  • 32
  • 55
  • Please try this (http://stackoverflow.com/questions/41116687/gradle-build-failing-after-update-to-android-studio-2-3-canary-3/41149031). might be helpful – Arti Mar 04 '17 at 11:08

3 Answers3

11

The reason behind taking too much time on refreshing gradle project is, it was downloading gradle distribution and each time and for some network issue the download was never being completed. The zip file for gradle distribution was 91MB. So the network error + slow internet connection made it impossible task for my Android Studio. I found two solution for this:

First approach is we have to download the gradle distribution manually from services.gradle.org/distributions. Then follow the process of this answer of the question - Android Studio Stuck at Gradle Download on create new project.

Second approach is somewhat like the first approach but less complex. Download gradle distribution. Extract it somewhere. Then go to:

File > Settings > Build, Execution and Deployment > Gradle

Check Use local gradle distribution. Set the Gradle home to the folder we have extracted.

Community
  • 1
  • 1
salmanwahed
  • 9,450
  • 7
  • 32
  • 55
4

I had the same problem

What I have done is

1.Close your project

2.Delete folders of .idea , .gradle, gradle folders from my project(not from home). then

3.File=>open your project

press ok in the dialogue box it will automatically set the gradle for you. or

You can specify gradle path

settings->build excecution deployment->build tools->gradle set your gradle home path to your downloaded gradle

Kiran Benny Joseph
  • 6,755
  • 4
  • 38
  • 57
0

I faced this case because of slow internet, Each time while beginning with the project, it downloads the gradles taking more time.Finally refreshing complete after waiting for 10 minute.

yubaraj poudel
  • 3,821
  • 1
  • 31
  • 28
  • 1
    The download itself was complete in about 15 seconds (100 MBit) but IntelliJ was still stuck at the download task. – spyro Nov 12 '20 at 10:57