gradle/gradle · error · ToolchainDownloadException
Unable to download toolchain matching the requirements ({})
Error message
Unable to download toolchain matching the requirements ({}) from '{}', due to: Invalid toolchain download url {} for {} on {} architecture. What it means
Error "Unable to download toolchain matching the requirements ({}) from '{}', due to: Invalid toolchain download url {} for {} on {} architecture." thrown in gradle/gradle.
Source
Thrown at platforms/core-runtime/client-services/src/main/java/org/gradle/launcher/daemon/toolchain/DaemonJavaToolchainProvisioningService.java:121
fileLock.close();
}
} catch (Exception e) {
progressLogger.completed("Failed to installed toolchain", true);
throw new ToolchainDownloadException(spec, uri, e);
}
}
}
private URI getBuildPlatformToolchainUrl(JavaToolchainSpec spec) {
String stringUri = toolchainDownloadUrlProvider.getToolchainDownloadUrlByPlatform().get(buildPlatform.toBuildPlatform());
try {
return new URI(stringUri);
} catch (NullPointerException e) {
String cause = String.format("No defined toolchain download url for %s on %s architecture.", buildPlatform.getOperatingSystem(), buildPlatform.getArchitecture().toString().toLowerCase(Locale.ROOT));
throw new ToolchainDownloadException(spec, stringUri, cause);
} catch (URISyntaxException e) {
String cause = String.format("Invalid toolchain download url %s for %s on %s architecture.", stringUri, buildPlatform.getOperatingSystem(), buildPlatform.getArchitecture().toString().toLowerCase(Locale.ROOT));
throw new ToolchainDownloadException(spec, stringUri, cause);
}
}
}
View on GitHub (pinned to 534f27719b)
Solutions
- Fix the toolchain download URL template configured in your toolchain resolver plugin.
- Use a maintained resolver plugin (e.g. Foojay) instead of a custom URL mapping.
- Install the required JDK manually and disable auto-download via org.gradle.java.installations.auto-download=false.
When it happens
Trigger: The toolchain resolver returned a download URL that is malformed or not usable.
Common situations: Custom toolchain resolver plugins producing incorrect URLs; misconfigured mirror or repository templates.
AI-assisted analysis of gradle/gradle@534f27719b (2026-08-22).
Data as JSON: /api/errors/ed46d9ad330d6ab6.
Report an issue: GitHub.