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

Android Studio 3.1.2在Win7企业笔记本首次安装后Gradle Sync失败,如何解决?

Fix Gradle Sync Failure (Connection Reset) for Android Studio 3.1.2 on Windows 7 Enterprise

Hey there, I’ve dealt with this exact headache before on Windows 7 with older Android Studio builds—let’s walk through the fixes that worked for me and other developers facing the same "connection reset" issue during Gradle plugin downloads.

1. Check Network & Proxy Settings First

  • First, confirm your Windows 7 system can access the internet properly. Try loading basic web pages to rule out a general network outage.
  • Open Android Studio and go to File > Settings > Appearance & Behavior > System Settings > HTTP Proxy. If you’re not using a corporate proxy, select No proxy and click Check connection to verify access to Gradle’s service endpoints (like https://services.gradle.org). If you do need a proxy, make sure the settings match your company’s requirements and test the connection again.

2. Switch to Domestic Maven Mirrors

Official repositories often have slow or unstable access from certain regions. Update your project’s build configuration to use faster domestic mirrors:

  • Open the root-level build.gradle file (not the one inside the app module).
  • Replace the repositories blocks with these mirrors:
buildscript {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    }
}
  • Save the file, then click the Sync Now button in the Android Studio toolbar to retry the sync.

3. Manually Download Gradle & Plugin Files

If automatic downloads keep failing, grab the files manually:

  1. Find your required Gradle version: Android Studio 3.1.2 pairs with Gradle 4.4. Check gradle/wrapper/gradle-wrapper.properties for the line distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip.
  2. Download this ZIP file and place it in C:\Users\YourUsername\.gradle\wrapper\dists\gradle-4.4-all\random-string-folder (create the folder if it doesn’t exist).
  3. Download the Android Gradle Plugin 3.1.2 package and put it in C:\Users\YourUsername\.gradle\caches\modules-2\files-2.1\com.android.tools.build\gradle\3.1.2 (again, create missing folders as needed).
  4. Restart Android Studio and trigger a sync again.

4. Fix Windows 7 Security & Protocol Restrictions

  • Firewall/Antivirus: Temporary disable Windows Firewall (or add Android Studio to its allowed apps list) and any corporate security software—these often block Gradle’s network requests.
  • Enable TLS 1.2: Windows 7 may not enable TLS 1.2 by default, which modern repositories require:
    1. Press Win+R, type regedit to open the Registry Editor.
    2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp.
    3. Create a new DWORD value named DefaultSecureProtocols and set its value to 0x00000A00 (this enables TLS 1.2).
    4. Restart your PC, then open Android Studio and try syncing again.

Start with the proxy/network checks—those are the most common fixes. If that doesn’t work, switching to domestic mirrors usually resolves download bottlenecks. Manual downloads are a reliable fallback when all else fails.

内容的提问来源于stack exchange,提问作者Annoth

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 10:02:28