Basically it downloads the Gradle build files for your current project according to its version and this whole work is done by your gradle wrapper which actually looks towards the basic requirement for your project and downloads the files according to that so whenever you are going to use any another projects of same ...
Gradle download in Android takes forever. The download is about 50MB, but Android Studio is still busy - 3 hours!!
Enable offline mode in Android Studio to disable checking for updates everytime. Go to Settings>Compiler>Gradle>Offline mode. If this is enabled the gradle will be told not to connect to internet and check for updates.
gradle, if you have minifyEnabled for debug, remove it. I had it in my project and it took ~2-3 minutes to build.
It is not stuck, it will take some time normally 5-7 mins , it also depends upon internet connection, so wait for some time. It will take time only for first launch.
Update: Check the latest log file in your C:\Users\<User>\.gradle\daemon\x.y
folder to see what it's downloading.
Yes, There is.
I found the same issue happening on my laptop, despite waiting for quite a long time. This is what I did and it worked for me. Just force close the Android Studio and launch it again. This time, just open the existing project and let it take care of finishing up the process of building/downloading.
Another option that you could possibly try is that if you look into File --> Settings, there is an option for Gradle location. You could go to the Gradle download site, download a local distribution of Gradle and point the Gradle location to that local directory.
If you're using OS X, and it continues to hang indefinitely, I'd recommend shutting down Android Studio (may have to force kill), then going to your ~/.gradle directory on the console. You'll see a wrapper/dists directory there and whatever version of gradle AS is trying to download. Check the timestamp of the download underneath the randomly named subdirectory. If you see that it is never changing, most likely your download was interrupted and AS wasn't able to restart it properly and will not unless you delete everything below the dists directory and start over.
So, with AS shutdown delete everything below ~/.gradle/wrapper/dists and then try again with a new project in AS. You can check the progress of the gradle download file (it will end in .part) to make sure that it's growing. Give it plenty of time as it IS a large file.
That's what finally worked for me.
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