在我的一个Android项目中,当我构建项目时,我有时会得到以下错误!我的天!
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)
我不知道为什么,但它大多数时候都很好。如何修复此错误?
2条答案
按热度按时间6g8kf2rb1#
我认为问题出在网络上,也许你的Gradle文件中有一些gradle或maven仓库,当你构建或运行项目时会超时。如果有,请在遇到此错误时注解它,然后重新构建。
n7taea2i2#
我有读取超时错误,然后启用gradle离线模式,可以再次构建没有问题