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

运行模拟器时遇':app:debugAnnotationProcessorClasspath'依赖解析失败求助

Fixing "Could not resolve com.google.auto:auto-common:0.8" Error with ButterKnife Compiler

Hey there, I’ve run into this exact dependency snag before when working with older ButterKnife versions. Let’s walk through the most reliable fixes to get your project building and running on the simulator again:

1. Make Sure Google Maven Repository is Enabled

The com.google.auto:auto-common dependency lives in Google’s Maven repository, so you need to confirm your project is configured to pull from it. Open your root project’s build.gradle file and check that the repositories block includes google():

// Root build.gradle
allprojects {
    repositories {
        google() // This is essential for accessing Google-hosted dependencies
        mavenCentral()
        // Add any other repositories your project relies on (e.g., jcenter if still needed)
    }
}

Older projects might only have mavenCentral() or jcenter(), but google() is non-negotiable here for this specific dependency.

2. Clear Gradle Cache and Resync

Corrupted or outdated Gradle cache files often cause resolution failures. Try these steps:

  • In Android Studio, go to File > Invalidate Caches..., check the Invalidate and Restart box, and let the IDE reload completely.
  • Alternatively, manually delete the .gradle folder in your project root and the build folder inside your app module, then run this command in your terminal:
    ./gradlew clean build
    

3. Explicitly Declare the Auto-Common Dependency

If the dependency still won’t resolve through ButterKnife’s transitive pull, force it by adding it directly to your app module’s build.gradle:

// App module build.gradle
dependencies {
    // Keep your existing ButterKnife declarations
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    
    // Add this line to explicitly fetch the required auto-common version
    annotationProcessor 'com.google.auto:auto-common:0.8'
}

This tells Gradle to grab the exact version you need, skipping any potential transitive resolution glitches.

4. Check Network Access

Sometimes the issue is simply a network block stopping Gradle from downloading dependencies. Confirm your internet connection is stable, and if you’re behind a corporate firewall or proxy, double-check that your Android Studio proxy settings are configured to access Maven repositories properly.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.21 04:03:50