Gradle "Could not download" Artifact - Fix Flaky Fetches in CI
By Daniel Zoghalchali·Latchkey
Gradle found the artifact in a repository but could not download its bytes - a read timeout or connection drop during the transfer. This is typically a transient network blip that clears on retry.
What this error means
Resolution fails with Could not download <group:name:version> and an underlying Read timed out or Connection reset. Re-running the job often succeeds with no change.
gradle output
> Could not download lib-2.3.1.jar (com.example:lib:2.3.1)
> Could not get resource 'https://repo.maven.apache.org/.../lib-2.3.1.jar'.
> Read timed out
Common causes
Transient timeout or reset mid-download
A slow mirror or a brief network drop times out the transfer. The artifact exists; only the download failed.
No local cache, so every jar is fetched live
Without a warm ~/.gradle/caches, CI downloads everything on each run, multiplying the chance one fetch fails.
How to fix it
Raise Gradle’s network timeouts and retry
Give downloads a longer timeout so slow mirrors do not abort, and let CI retry the step.
Cache ~/.gradle/caches and ~/.gradle/wrapper in CI.
Raise connection/socket timeouts for slow mirrors.
Resolve through a pull-through mirror to reduce live downloads.
Frequently asked questions
What causes ""Could not download""?
A slow mirror or a brief network drop times out the transfer. The artifact exists; only the download failed.
How do I fix "Could not download"?
Give downloads a longer timeout so slow mirrors do not abort, and let CI retry the step.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.