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

Android构建报错:无法解析':app:debugCompileClasspath'配置的所有文件(ShineButton API引入问题)

Fixing "Could not resolve all files for configuration ':app:debugCompileClasspath'" with ShineButton Dependency

Let’s work through the most common fixes for this build error when adding the ShineButton library:

1. Ensure Maven Central is Added to Repositories

First, confirm your project is configured to pull dependencies from Maven Central—this is where ShineButton is hosted.

For older Android Studio versions (project-level build.gradle):

allprojects {
    repositories {
        google()
        mavenCentral() // This line is critical for accessing the library
        jcenter() // Optional, but useful for some legacy dependencies
    }
}

For newer versions (Android Studio Arctic Fox+, use settings.gradle):

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral() // Add this if it's missing
    }
}

2. Verify the Dependency Version

While 1.0.0 is a valid version for ShineButton, double-check you haven’t mistyped the dependency string. If issues persist, you can confirm the latest available version from the library’s release notes, but start by re-syncing with the version you already have.

3. Sync Project and Clear Gradle Caches

Build cache corruption is a frequent culprit here:

  • Click the Sync Project with Gradle Files button (the elephant icon in Android Studio’s toolbar).
  • If syncing fails, clear caches completely: go to File > Invalidate Caches... > Invalidate and Restart. You can also manually delete the .gradle folder in your project root and the build folders in your app module before re-syncing.

4. Check Network and Proxy Settings

Gradle needs to download the dependency from Maven Central, so make sure your network isn’t blocking access to external repositories. If you’re behind a corporate proxy, add these settings to your gradle.properties file:

systemProp.http.proxyHost=your-proxy-address
systemProp.http.proxyPort=your-proxy-port
systemProp.https.proxyHost=your-proxy-address
systemProp.https.proxyPort=your-proxy-port

5. Manually Add the Library (Last Resort)

If all other steps fail, you can download the library’s AAR file and add it locally:

  • Grab the shinebutton-1.0.0.aar file from Maven Central
  • Create a libs folder in your app module if it doesn’t exist
  • Place the AAR inside the libs folder
  • Update your app-level build.gradle to use the local file:
    dependencies {
        implementation files('libs/shinebutton-1.0.0.aar')
    }
    

Note: This error almost always means Gradle can’t fetch the dependency from its configured repositories, so the steps above should cover most root causes.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.27 17:32:27