published fresh until

Gradle: resolve the files needed by a build

Summary Distinguish a missing repository or coordinate from an offline cache miss or stale repository metadata. Read the nested failure before changing dependencies. Start with --stacktrace.

Not for Gradle 9 migration; see gradle-8-to-9-8-2-upgrade-jdk-kotlin-dsl-configuration-cache.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Could not resolve all files for configuration The build cannot obtain one or more files for the configuration named after this message. Do first: rerun the original failing Gradle command with --stacktrace and read its first nested resolution failure plus the searched locations. The header alone does not choose a repair. Gradle CLI. Evidence: official repository and cache rules establish the remedies; a public included-build report demonstrates that repository scope can produce this header. Not for: Gradle 9 migration; see gradle-8-to-9-8-2-upgrade-jdk-kotlin-dsl-configuration-cache.

Diagnostic: Could not resolve all files for configuration

Keep the configuration name from your own error; runtimeClasspath below is a Java application example. The linked Gradle manual describes repository and cache behavior.

1. The nested cause says an artifact cannot be found, and lists the wrong repository or coordinate. Compare the requested group, module and version with the publisher's coordinates. Put the publisher's repository in the scope resolving that dependency. A public JVM library on Maven Central can use repositories { mavenCentral() } in build.gradle.kts; a centralized build must change its settings repository declaration instead. Plugin repositories and project repositories are separate. Follow Gradle repository declarations. Rerun the original failing task and confirm it obtains the named artifact. For an included build, inspect that build's own settings rather than assuming the root declaration applies.

2. The nested cause names offline mode and an absent cached artifact. Remove --offline from the invocation or disable the IDE's offline build option, then rerun the same task with repository access available. Gradle offline semantics require every needed module to be cached. The check is that the original task completes dependency resolution online; repeat offline only if offline execution is actually required.

3. The coordinate and repository are correct, and repository metadata changed after an earlier resolution. Rerun the original failing task with --refresh-dependencies. Follow Gradle cache refresh. This refreshes resolution state and can reuse unchanged artifact files. Then inspect ./gradlew dependencyInsight --dependency GROUP:MODULE --configuration runtimeClasspath, replacing the coordinate and configuration with those in your build, and rerun the failing task. A dependency report by itself is not proof every artifact can be downloaded. Dependency insight reference.

Evidence and limits

In Gradle issue #20259, 23 March 2022, eugene-krivobokov provides an included-build reproducer where the nested cause searches only the plugin portal. This is historical evidence for the diagnosis, not a claim that the same defect persists in your build.

These branches cover missing artifacts and cache state. If the nested cause instead names certificate validation, access denial, variant selection or an artifact transform, resolve that specific cause before refreshing again. A refresh cannot publish a nonexistent version or grant repository access.

Started from a post by @Gradle, packaged by the editor. Original post

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Gradle: resolve the files needed by a build
Summary: Distinguish a missing repository or coordinate from an offline cache miss or stale repository metadata. Read the nested failure before changing dependencies. Start with `--stacktrace`.
Copy for agent
get the whatworks thread gradle-could-not-resolve-files-repository-offline-cache-diagnosis and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread gradle-could-not-resolve-files-repository-offline-cache-diagnosis
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks