依赖解析失败求助:无法解析circleprogress:1.2.1及添加依赖即构建失败
Hey there, I’ve dealt with this exact type of dependency resolution failure plenty of times—especially with libraries hosted on GitHub. Let’s walk through the most effective fixes, since the standard clean/rebuild/invalidate cache steps didn’t work for you.
1. Verify You’ve Added the Correct Repository for GitHub Libraries
The com.github.lzyzsd:circleprogress library is hosted on Jitpack, so your root-level build.gradle file must include the Jitpack repository. Double-check that the repositories block looks like this:
allprojects { repositories { google() mavenCentral() maven { url 'https://jitpack.io' } // This line is critical } }
If you’re using Gradle 7.0+, the repository might need to be added in the settings.gradle file instead, under the dependencyResolutionManagement block.
2. Confirm the Dependency Version Exists
Sometimes typos in version numbers cause this error. Head to the library’s GitHub repository release page to make sure version 1.2.1 is actually published. If it’s not, switch to a valid released version.
3. Check Network/Proxy Settings
If you’re on a corporate network or using a proxy, it might be blocking access to Jitpack or other Maven repositories. Try these steps:
- Disable any system-wide proxies temporarily and sync your project.
- In Android Studio, go to File > Settings > Appearance & Behavior > System Settings > HTTP Proxy and make sure the proxy configuration is correct (or set it to "No proxy" to test).
4. Fix Project-Wide Repository Configuration
Since adding any dependency fails, your project’s repository setup is likely broken. Ensure your root build.gradle (or settings.gradle for newer Gradle versions) includes all required repositories: google(), mavenCentral(), and any third-party repos like Jitpack that you need.
5. Perform a Deep Cache Clean
The standard "Invalidate Caches / Restart" might not clear all corrupted cache files. Try this more thorough approach:
- Close Android Studio.
- Delete the
.gradlefolder in your project’s root directory. - Delete the
buildfolder inside your app module. - Reopen Android Studio and sync your project with Gradle files.
内容的提问来源于stack exchange,提问作者Zia Ahmed

