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?
Reload a linked Gradle project In the Gradle tool window, right-click a linked project. On invoking this action, IntelliJ IDEA parses the project structure in the Gradle tool window. IntelliJ IDEA cannot reload just a part of your project, it reloads the whole project including modules and dependencies.
One bit of a downside is that it takes roughly 3 minutes to re-sync when we "Import Gradle Project". There is no feedback to tell us what it is doing, so it's hard to know what we might tweak to see if we can get it faster. We are on the latest - 2019.2. x.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With