mBarati
mBarati

Reputation: 100

Android Gradle Read timed out

In one of my android projects when i build the project, I sometimes get the following Error!! :

Read timed out
org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':app:preDebugBuild'.
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Caused by: java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
    at java.net.SocketInputStream.read(SocketInputStream.java:171)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
    at sun.security.ssl.InputRecord.read(InputRecord.java:503)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
    at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
    at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)

I don't know why but it built ok most of the times. How can i fix this error?

Upvotes: 2

Views: 2404

Answers (2)

Gelson Schikorski
Gelson Schikorski

Reputation: 89

I was having the Read Time Out error, then enabled gradle offline mode and could build again whitout problems

Upvotes: 0

zahra
zahra

Reputation: 98

I think problem is network, maybe you have some gradle or maven repositories in your Gradle file that get timeout when you build or run project. if you have so, comment it whenever you get this error and build again.

Upvotes: 1

Related Questions