Android Studio Gradle Build Error: Read Time Out

后端 未结 12 1624
太阳男子
太阳男子 2020-12-03 03:22

I have the latest Android Studio IDE installed on my Windows 10 laptop, and it was working fine until my windows operating system made a huge automatic update.

Now,

相关标签:
12条回答
  • 2020-12-03 03:25

    I just removed

    include ':app'

    from setting.gradle and then sync project

    it will fails again

    then write it back an re-sync and then error gone and will start downloading.

    0 讨论(0)
  • 2020-12-03 03:28

    For Chinese users who often use a proxy to download dependency jars, the cause is often proxy settings.

    We should check multiple places if the proxy is correctly configured.

    • Android Studio Settings - Appearance & Behavior - System Settings - HTTP Proxy
    • ${project_root}/gradle.properties
    • ~/.gradle/gradle.properties

    In my case, I somehow once configured an HTTP proxy in ~/.gradle/gradle.properties, which was forgotten later. Then when I dealt with a SOCKS5 proxy in IDE Settings and project-level gradle.properties, things always run into trouble. Finally, deleting invalid proxy settings in ~/.gradle/gradle.properties save my day.

    0 讨论(0)
  • 2020-12-03 03:29

    Use the following code in gradle.properties :

    systemProp.http.proxyHost=www.somehost.org
    systemProp.http.proxyPort=8080
    systemProp.http.proxyUser=userid
    systemProp.http.proxyPassword=password
    systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
    org.gradle.daemon=false
    
    0 讨论(0)
  • 2020-12-03 03:30

    None of the answer worked for me.

    I solved it by

    1. Delete project>.gradle directory
    2. File>Sync Project with Gradle Files
    0 讨论(0)
  • 2020-12-03 03:43

    I encounter this error "Read Time Out", and I simply choose menu item: File -> Invalidate Caches / Restart... to fixed it.

    [UPDATE]

    I just encounter this error for second time, this time Invalidate Caches / Restart... not able to fix it, but then I try close the android Studio, killall -9 java to ensure all java process has been terminated, then relaunch Android Studio, no more error.

    [UPDATE 2] I just encounter this error and I fixed it by replug the phone cable and rerun.

    0 讨论(0)
  • 2020-12-03 03:44

    Editing global gradle.properties with the following line was the fix for me:

    org.gradle.jvmargs=-Dorg.gradle.internal.http.connectionTimeout=120000 -Dorg.gradle.internal.http.socketTimeout=120000
    
    0 讨论(0)
提交回复
热议问题