You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows更新后Android Studio Gradle同步失败:Read timed out 求助

Fixing "Gradle sync failed: Read timed out" After Windows 10 Update in Android Studio

Hey there, sorry to hear you're stuck with this Gradle sync timeout issue post-Windows 10 update—this is a common hiccup after system updates, and we can work through it step by step. Here are the most effective fixes to try:

1. Switch to a Domestic Maven Mirror (Network Dependency Fix)

More often than not, the timeout happens because Gradle's default repositories are slow to access from your network. Replace the default repos with a faster domestic mirror in your project's root build.gradle file:

buildscript {
    repositories {
        // Replace default repos with these
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
    }
    // ... rest of your buildscript code
}

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
    }
}

After making changes, click Sync Now and see if the timeout goes away.

2. Increase Gradle Sync Timeout Limits

Windows updates might have tweaked system resource allocations, causing Gradle to hit its timeout threshold too soon. You can extend this in two ways:

  • Via IDE Settings: Go to File > Settings > Build, Execution, Deployment > Build Tools > Gradle. Under Gradle VM options, add -Dorg.gradle.timeout=300 (sets timeout to 5 minutes).
  • Via gradle.properties: Open your project's gradle.properties file and add these lines:
    org.gradle.jvmargs=-Xmx2048m -Dorg.gradle.timeout=300
    org.gradle.parallel=true
    

3. Clear Corrupted Gradle Cache

System updates sometimes mess with cached Gradle files. Delete the cache folder to force a fresh download:

  • Navigate to C:\Users\<Your Username>\.gradle\caches
  • Delete all contents inside this folder (don't worry, Gradle will rebuild it)
  • Restart Android Studio and trigger a sync again

4. Check Windows Firewall/Antivirus Restrictions

Windows 10 updates often reset firewall or antivirus rules, blocking Android Studio from accessing the internet.

  • Open Windows Defender Firewall > Allow an app or feature through Windows Defender Firewall
  • Find Android Studio in the list, make sure both Private and Public boxes are checked
  • If it's not listed, click Change settings > Allow another app and browse to your Android Studio executable (usually in C:\Program Files\Android\Android Studio\bin\studio64.exe)
  • Temporarily disable your antivirus software and test the sync—if it works, add AS to your antivirus whitelist

5. Update Gradle and Android Gradle Plugin

Outdated Gradle versions might conflict with the updated Windows environment.

  • Update Gradle Wrapper: Open gradle/wrapper/gradle-wrapper.properties and update the distributionUrl to the latest stable version (e.g., https\://services.gradle.org/distributions/gradle-8.4-all.zip)
  • Update Android Gradle Plugin: In your project's root build.gradle, update the com.android.tools.build:gradle dependency to match the Gradle version (check the official compatibility table if unsure)

6. Reset Android Studio to Default Settings

If none of the above works, a corrupted IDE setting from the Windows update might be the culprit:

  • Go to File > Manage IDE Settings > Restore Default Settings
  • Confirm the reset, restart Android Studio, then re-import your project and sync

Give these steps a try one by one—most users fix this issue with the first three steps. Good luck!

内容的提问来源于stack exchange,提问作者Daniel W.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:15:24