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

Android Studio 3.1.0项目同步失败:找不到builder.jar (com.android.tools.build:builder:3.1.0)

Fixing "Could not find builder.jar (com.android.tools.build:builder:3.1.0)" in Android Studio 3.1.0

Hey there, let's work through this Gradle sync error you're hitting with Android Studio 3.1.0 and Gradle 4.6. I've dealt with similar dependency resolution headaches before, so here are actionable fixes to try out:

  • Verify your repository configuration
    Open your project's root build.gradle file and make sure the Google Maven repository is listed first in the buildscript repositories section. Older Android Studio versions might not recognize the shorthand google() yet, so you can use the full URL instead:

    buildscript {
        repositories {
            // Use this line if google() doesn't work for your AS version
            maven { url 'https://dl.google.com/dl/android/maven2/' }
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.0'
        }
    }
    

    Putting the Google repo first ensures Gradle checks it before other repositories, which avoids missing Google-specific dependencies like the builder jar.

  • Manually add the builder jar to your local Gradle cache
    If the automatic download is failing, you can grab the jar manually and place it in your local Gradle cache:

    1. Locate your local Gradle cache directory:
      • On macOS/Linux: ~/.gradle/caches/modules-2/files-2.1/com.android.tools.build/builder/3.1.0/
      • On Windows: C:\Users\[YourUsername]\.gradle\caches\modules-2\files-2.1\com.android.tools.build\builder\3.1.0\
    2. Download the builder-3.1.0.jar file (you can find it via Maven repository searches) and place it in the folder above (you might need to create the 3.1.0 subfolder if it doesn't exist).
    3. Restart Android Studio and re-sync your project.
  • Clear Gradle caches and restart
    Corrupted cache files often cause these kinds of issues. Try these steps:

    1. Go to File > Invalidate Caches / Restart in Android Studio.
    2. Select Invalidate and Restart to clear both IDE and Gradle caches.
    3. Once the IDE restarts, trigger a Gradle sync again.
      Alternatively, you can manually delete the entire .gradle/caches folder on your system, then re-sync.
  • Check network and proxy settings
    A flaky network or misconfigured proxy can block Gradle from accessing the Google Maven repo. Try:

    • Disabling any VPN or proxy temporarily to see if the sync works.
    • Verifying your proxy settings in File > Settings > Appearance & Behavior > System Settings > HTTP Proxy to ensure they allow access to Google's Maven servers.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.22 09:59:34