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.
> 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:libCommon 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.
repositories {
mavenCentral()
maven { url 'https://nexus.example.com/repo' }
}
dependencies {
implementation 'com.example:lib:1.4.0' // explicit version
}Diagnose the unresolved dependency
- Run
./gradlew :app:dependencies --configuration runtimeClasspathto see what fails to resolve. - Use
dependencyInsight --dependency libto find who requests it and why it conflicts. - 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 dependenciesin CI.