Reputation: 31
I start a new project on android studio 3.1.2, but it sync failed. The error message is "read time out". I've tried multiple variations of this, but none of them seem to work. It seems that android studio is unable to download the project dependencies from the remote repository. I have tried several methods including setting a http proxy, adding other repositories in the build.gradle file. Here is some message.
click to view build.gradle file
Thanks in advance!
Upvotes: 3
Views: 4897
Reputation: 31
The problem is related to the .gradle\caches, so if you can return to the last content of your caches folder, I did that and the problem disappeared. OR File-> Invalidate Caches/Restart...
Upvotes: 0
Reputation: 21
i have faced the same issue, try this order it fixes the issue.
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
google()
}
Upvotes: 2
Reputation: 21
When you build project for first time, gradle sync takes time also check the internet connectivity before starting gradle sync. From the attached screenshot, sockettimeoutexception appears due to internet connectivity failure or slow connection.
Upvotes: 0