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?

- 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 Answers
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.

- 1
- 1

- 9,450
- 7
- 32
- 55
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). then3.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

- 6,755
- 4
- 38
- 57
-
I have gone through these steps several times and also tried some other ways. I actually where it gets stuck while `refreshing project`. – salmanwahed Mar 04 '17 at 10:46
-
Yes. Removed the `gradle` directory from project, remove `.gradle` from home. – salmanwahed Mar 04 '17 at 10:48
-
@salmanwahed please remove `.gradle` file from your project also – Kiran Benny Joseph Mar 04 '17 at 10:49
-
Have tried these actually with no luck. Can you tell me the reason why should I delete all these? – salmanwahed Mar 04 '17 at 10:51
-
because the gradle distribution is changed. And if you manually set this . Error may occur – Kiran Benny Joseph Mar 04 '17 at 10:52
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/137208/discussion-between-kiran-benny-joseph-and-salman-wahed). – Kiran Benny Joseph Mar 04 '17 at 10:53
-
Downloading gradle manually and using the local gradle distribution solved this issue for now. Thank you very much for your help. – salmanwahed Mar 04 '17 at 12:53
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.

- 3,821
- 1
- 31
- 28
-
1The 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