Gradle cannot resolve the files of :app:debugRuntimeClasspath after adding a dependency
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.Short answer
After you add a dependency, Gradle must download it and everything it needs. This error means one artifact in the chain could not be found. Read the 'Could not find' line under it: it names the artifact and the repositories searched. The cause is a missing repository, a version that does not exist, or an artifact that is not in Google's Maven repository.
Fix it fast
1Find out which cause you have
Print the resolved tree for the failing configuration. Lines marked FAILED name the artifact Gradle could not get.
./gradlew :app:dependencies --configuration debugRuntimeClasspath2Match what you see, then jump to its fix
- 1
Could not find ... followed by a list of searched locations that lacks the hostThe repository that hosts the artifact is not declaredFix - 2
Could not find group:name:version and the repositories are correctThe group, name or version does not existFix - 3
An old guide's version of a Google or AndroidX library fails while newer versions resolveAn older library version is missing from Google's Maven repositoryFix
- 1
What does the error look like?
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.Could not find com.example:library:1.0.0.
Cause 1 of 3
The repository that hosts the artifact is not declared
1Check
Gradle looks only in the dependencyResolutionManagement repositories of settings.gradle. Compare that block with the home of the library you added: AndroidX and Firebase come from google(), most other libraries from mavenCentral().
grep -n -A8 "dependencyResolutionManagement" settings.gradle settings.gradle.kts 2>/dev/null2Fix
Add the missing repository to that block and sync.
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}3Verify
The tree shows the artifact with a version instead of FAILED.
./gradlew :app:dependencies --configuration debugRuntimeClasspath | grep FAILEDConfirmed by developer.android.com
Cause 2 of 3
The group, name or version does not exist
1Check
A typo, or a version that was never released, gives the same message as a missing repository. Google's Maven repository publishes a version list for each group, so you can compare against it for AndroidX and Firebase libraries.
curl -s https://maven.google.com/androidx/appcompat/group-index.xml | head -n 202Fix
Copy the coordinates and the latest version from the library's own release page and correct the line in your build file or version catalog.
dependencies {
implementation("androidx.appcompat:appcompat:1.7.0")
}3Verify
Sync; the dependency resolves.
./gradlew :app:dependencies --configuration debugRuntimeClasspath | grep appcompatConfirmed by developer.android.com
Cause 3 of 3
An older library version is missing from Google's Maven repository
1Check
Android's docs state that older versions of Google libraries are not in the Maven repository and must come from the offline repository in the SDK Manager.
ls "$ANDROID_HOME/extras"2Fix
The simple fix is to move to a current version. If you must keep the old one, install the Google Repository package from the SDK Manager first.
dependencies {
implementation("androidx.appcompat:appcompat:1.7.0")
}3Verify
A clean build gets past dependency resolution.
./gradlew clean :app:assembleDebugConfirmed by developer.android.com
How do I stop it coming back?
- Keep the repository list in settings.gradle only and review it when you add an SDK.
- Take coordinates from the library's release notes, not from copied snippets.
- Use a version catalog so one version string serves every module.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Mobile apps
Android Studio cannot resolve a com.github.* library that comes from JitPack or JCenter
Could not find com.github.User:Repo:Tag
Gradle only searches the repositories you list.
3 causes, each with a fixMobile apps
Gradle fails to resolve the buildscript classpath, so the build never starts
Could not find com.android.tools.build:gradle:8.x.x.
Gradle could not download a build plugin, usually the Android Gradle plugin.
3 causes, each with a fixMobile apps
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile apps
Android Studio cannot pair the phone over Wi-Fi
The Pair devices over Wi-Fi dialog lists no device
Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.
4 causes, each with a fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fix