Skip to content
Latchkey

GitHub Actions gradle/actions/setup-gradle Fails to Download the Distribution

gradle/actions/setup-gradle could not obtain the Gradle distribution. Most often this is a transient download failure from the distribution host; sometimes it is a wrapper checksum mismatch or an invalid gradle-version.

What this error means

The setup-gradle (or first gradlew) step fails while downloading the Gradle distribution, with a network read timeout or a checksum verification error. Re-running frequently succeeds, which points to a transient fetch.

Actions log
Exception in thread "main" java.io.IOException: Downloading from
https://services.gradle.org/distributions/gradle-8.7-bin.zip failed: timeout

Common causes

Transient distribution download failure

Fetching the Gradle distribution over the network can time out or reset during a brief services.gradle.org or registry outage, failing the step through no fault of the config.

Wrapper checksum or version mismatch

A distributionSha256Sum in gradle-wrapper.properties that does not match, or a non-existent gradle-version, makes the download fail validation deterministically.

How to fix it

Pin a valid version and let it cache

.github/workflows/ci.yml
- uses: gradle/actions/setup-gradle@v4
  with:
    gradle-version: wrapper   # use the version from gradle-wrapper.properties

Retry transient downloads; fix real checksum errors

  1. Re-run the job when the failure is a timeout or connection reset on the distribution download.
  2. If it is a checksum mismatch, correct distributionSha256Sum in gradle-wrapper.properties.
  3. Confirm the requested gradle-version actually exists.

How to prevent it

  • Use gradle-version: wrapper so the version comes from the committed wrapper.
  • Keep a correct distribution checksum in gradle-wrapper.properties.
  • Retry transient distribution-download failures rather than churning config.

Frequently asked questions

What causes "setup-gradle download"?
Fetching the Gradle distribution over the network can time out or reset during a brief services.gradle.org or registry outage, failing the step through no fault of the config.
How do I fix setup-gradle download?
Pin a valid version and let it cache
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.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card