Skip to content
Latchkey

Gradle "Could not resolve all task dependencies" in CI - Fix Resolution

This error means Gradle could not assemble a configuration (e.g. runtimeClasspath) because one of its dependencies would not resolve - a missing version, a dependency not in any declared repository, or a constraint conflict. The build stops before the task runs.

What this error means

A task fails with Could not resolve all task dependencies for configuration ':app:runtimeClasspath' followed by Could not find com.example:lib: or a version-conflict message.

gradle
> Could not resolve all task dependencies for configuration ':app:runtimeClasspath'.
   > Could not find com.example:lib:.
     Required by:
         project :app
   > No version specified for com.example:lib

Common causes

Missing version or repository

A dependency declared with no version (and no BOM/platform supplying one), or hosted in a repo not listed under repositories, cannot be resolved.

Constraint or capability conflict

Conflicting strict versions or a capability clash can make the configuration unresolvable.

How to fix it

Supply the version and the repository

Pin a version (directly or via a platform) and ensure the hosting repo is declared.

build.gradle
repositories {
  mavenCentral()
  maven { url 'https://nexus.example.com/repo' }
}
dependencies {
  implementation 'com.example:lib:1.4.0'   // explicit version
}

Diagnose the unresolved dependency

  1. Run ./gradlew :app:dependencies --configuration runtimeClasspath to see what fails to resolve.
  2. Use dependencyInsight --dependency lib to find who requests it and why it conflicts.
  3. Add a platform(...)/BOM if versions should come from a managed set.

How to prevent it

  • Always supply versions (directly or via a platform), declare every needed repository, and check resolution with gradle dependencies in CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →