Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle sync failed: connection time out: consult IDE log for more details

I just installed Android studio 2.3.1, but after starting it is telling me "Grade sync failed: connection time out: connect consult IDE log for more details". Pls I don't know what to do.

like image 496
walexy190 Avatar asked Dec 23 '22 18:12

walexy190


2 Answers

Caused by: java.util.zip.ZipException: error in opening zip file This mean that a file that Gradle has downloaded has become corrupted due to somehow or some reason. This might be the download of Gradle itself (which the wrapper does) or any dependency that Gradle has downloaded to run your build.

Gradle doesn't attempt to detect or resolve the problem, so you need to fix it manually. The solution is often to purge Gradle's download caches and let it get fresh copies of what it needs.

To do that, delete the .gradle directories in both your home directory and in your project's root directory and try building again.

In window home directory of gradle is

C:\Users\User.gradle In Mac OSX home directory

/Users/User_name/.gradle

like image 79
anisnouioua Avatar answered Jan 13 '23 12:01

anisnouioua


If you still haven't figured out this problem yet, it's because you literally have no internet connection which is mandatory for gradle building since the platform checks for potential updates for say, sdk versions, from a server.

However, if you want to build and do your work offline, then go to File -> Settings -> Build, Execution, Deployment -> Gradle -> Check Offline work under Global Gradle settings

like image 27
DaveNOTDavid Avatar answered Jan 13 '23 14:01

DaveNOTDavid