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

Android Studio构建报错:无法下载bundletool.jar

Fixing "Could not download bundletool.jar (com.android.tools.build:bundletool:0.1.0-alpha01)" Error in Android Studio

Hey there! As someone new to Android Studio, this dependency download error can feel frustrating, but let's work through it step by step:

1. Update the Bundletool Version (Most Likely Fix)

The version 0.1.0-alpha01 is an extremely early, unstable alpha release that's probably no longer hosted in official Maven repositories. Let's switch to a stable, supported version:

  • Open your project root directory's build.gradle file (not the one inside your app module).
  • Look for the buildscript block's dependencies section. You'll see a line like this:
    classpath 'com.android.tools.build:bundletool:0.1.0-alpha01'
    
  • Replace it with a recent stable version (e.g., 1.15.0 – you can check for the latest stable version via Android Studio's dependency suggestions):
    classpath 'com.android.tools.build:bundletool:1.15.0'
    
  • Click "Sync Project with Gradle Files" (the elephant icon in the toolbar) to apply changes.

2. Verify Maven Repository Configurations

Bundletool is hosted on Google's Maven repository, so make sure your project is set to pull from it:

  • In the same root build.gradle file, check both the buildscript and allprojects blocks' repositories sections. Ensure they include:
    repositories {
        google()
        mavenCentral()
    }
    
  • If google() was missing, add it, then sync the project again.

3. Clear Gradle's Local Cache

Sometimes corrupted cache files cause download issues. Let's do a deeper clean than just "Invalidate Caches/Restart":

  • Close Android Studio.
  • Navigate to your local Gradle cache directory:
    • Windows: C:\Users\<YourUsername>\.gradle\caches
    • Mac/Linux: ~/.gradle/caches
  • Delete the modules-2 folder (this stores downloaded dependency files).
  • Reopen Android Studio and sync the project again.

4. Manual Download (Last Resort)

If you absolutely need to use 0.1.0-alpha01 (not recommended), you can manually place the jar in Gradle's cache:

  • Download the bundletool-0.1.0-alpha01.jar from Google's Maven repository.
  • Navigate to ~/.gradle/caches/modules-2/files-2.1/com.android.tools.build/bundletool/0.1.0-alpha01 (create the directories if they don't exist).
  • Place the downloaded jar in this folder – you may need to match the existing hash-named subfolder (if one exists) or create a new one with the correct hash for the file.

A quick tip for future projects: Stick to stable release versions of dependencies whenever possible, as alpha/beta versions are often removed or replaced once stable builds are available.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 07:02:53