gradle: Could not resolve all files for configuration ':app:debugRuntimeClasspath'" after a version bump - how to fix
Fixes Gradle's Could not resolve all files for configuration ':app:debugRuntimeClasspath' after a version bump. Use it when an Android or JVM build fails at dependency resolution naming that configuration. Key trigger: the dependencies task on that configuration shows the version conflict or the missing artifact, and the fix is forcing or aligning the version with a resolution strategy or a platform BOM.
TL;DR: Something in the bumped dependency graph no longer resolves for the debug runtime classpath, usually a version conflict or a relocated artifact. Run the dependencies task scoped to :app:debugRuntimeClasspath to see exactly which module fails. Then force the winning version with a resolution strategy or align everything with a BOM platform. Refresh and rebuild.
The error
"gradle: Could not resolve all files for configuration ':app:debugRuntimeClasspath'" after a version bump - how to fixSteps to fix
Inspect the failing configuration: ./gradlew :app:dependencies --configuration debugRuntimeClasspath and search the output for FAILED or conflict markers. Expected: You see which module conflicts, for example two versions of a library selected by different parents, or a version that no longer exists in the repo.
For a version conflict, force one version in the app module's build file: a resolutionStrategy block with force 'group:artifact:2.1.0' (use your real coordinates). Expected: The next resolution picks the forced version for the whole configuration.
For a family of libraries that must move together (for example AndroidX or Kotlin), declare a platform BOM: implementation platform('group:bom:2.1.0'). Expected: All BOM-managed modules align to one consistent set.
If the artifact moved repos, check the repository declarations; then run ./gradlew :app:dependencies --configuration debugRuntimeClasspath --refresh-dependencies. Expected: The FAILED marker disappears from the dependencies output.
Run ./gradlew :app:assembleDebug and the relevant tests. Expected: The build completes and tests pass on the resolved graph.
Use this when
- Gradle fails with Could not resolve all files for configuration ':app:debugRuntimeClasspath' after a version bump
- An Android dependency upgrade breaks resolution while other configurations still resolve
- You need to find which transitive dependency conflicts in a specific configuration
Not for this skill when
- Compilation errors after resolution succeeds, which are API problems, not resolution problems
- Gradle daemon or memory crashes during the build
- Signing or keystore failures at assembleRelease time
Variant phrasings
- Could not resolve all files for configuration ':app:debugCompileClasspath'
- Could not find group:artifact:version required by project :app
- Execution failed for task ':app:mergeDebugNativeLibs' after upgrade
Why it happens
Gradle resolves each configuration independently, and debugRuntimeClasspath is the full runtime graph for the debug variant: every transitive dependency of every debug dependency must resolve to a downloadable artifact. A bump can introduce a conflict (two parents wanting different versions of one module) or point at an artifact that was relocated or removed from the repository. Gradle fails the whole configuration instead of shipping a half-resolved classpath.
Edge cases
- force is a hammer; prefer a platform BOM or a dependency constraint when a whole family must stay aligned.
- Forcing a newer version can break the library that wanted the older one; run the app's tests, not just the build.
- --refresh-dependencies re-downloads dynamic versions and can surprise you; pin exact versions in version catalogs.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst9tGUukYwJLEXQcnIxE1iA