You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Android Studio 3.2 Canary14 Clean-Rebuild失败:找不到aapt2:3.2.0-alpha14-4748712

Fix: Could not find com.android.tools.build:aapt2:3.2.0-alpha14-4748712

Hey fellow dev, I’ve run into this exact issue before—here’s how to fix it quickly:

What’s the root cause?

Starting with Android Studio 3.2, Google moved the AAPT2 tool (which handles Android resource processing) out of the old SDK extras repositories and into the Google Maven Repository. Your build is failing because it’s only searching the outdated locations (like local SDK extras folders and jcenter) that don’t host this alpha version of AAPT2.

Step-by-Step Fix

  1. Open the root-level build.gradle file of your project (not the one inside the app module).
  2. Find the allprojects > repositories block in this file.
  3. Add the google() repository entry—list it before other repositories like jcenter to ensure priority:
allprojects {
    repositories {
        google() // This is the missing line in your build setup
        jcenter()
        // Add any other repositories you use here (e.g., mavenCentral)
    }
}

For older Gradle versions (just in case):

If you’re using a Gradle plugin version older than 4.0 (unlikely for Android Studio 3.2 Canary, but worth noting), replace google() with the full Maven URL:

maven { url 'https://maven.google.com' }
  1. Click the "Sync Now" prompt that appears to sync your project with the updated Gradle configuration.
  2. Run Clean > Rebuild again—this should resolve the missing AAPT2 dependency error.

Why this works

The google() repository hosts all the latest Android build tools, including alpha/beta versions of AAPT2 that aren’t available in the old SDK extras folders or jcenter. Adding it tells your build system to look in the correct, up-to-date location for the required files.

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

火山引擎 最新活动