Any idea how to resolve this? ```Unable to downloa...
# community-support
s
Any idea how to resolve this?
Copy code
Unable to download toolchain matching the requirements ({languageVersion=21, vendor=Eclipse Temurin, implementation=vendor-specific}) from 'null', due to: No defined toolchain download url for LINUX on x86_64 architecture.
This occurs when building a Kotlin project with Gradle 8.14 on some machine, but not generally. In particular, what does
from 'null'
refer to, a URL that's
null
?
v
I think you use toolchains without a toolchain provider. If you run on a machine where an installed Temurin 21 is installed it works. But if you would need to provision one, it fails as no provisioning source is defined. If you apply the foojay-resolver plugin to the settings script, that should probably fix the problem.
s
Thanks, I'll give the foojay-resolver plugin a try here. However, nit-picking a bit on your wording, AFAIU Gradle comes with built-in toolchain providers. It's just that they cannot find any suitable installation, right?
In any case, I believe Gradle's error message could be clearer here.
v
The detection of installed (including previously auto-provisioned) relocations is built-in. The auto-provisioning itself is built-in. But there is by default no URL where to auto-provision from built-in. For being able to auto-provision, you have to provide a toolchain resolver plugin. These plugins map toolchain requests to download responses, which currently contain only the URL to download from. The foojay toolchains plugin provides such a mapping by asking the foojay disco API for the appropriate download URL. The foojay toolchains convention plugin applies that plugin and configures it for the typical use-case. For more details, have a look at https://docs.gradle.org/current/userguide/toolchains.html#sec:provisioning
In any case, I believe Gradle's error message could be clearer here.
Error messages can always be clearer. :-D But I think
No defined toolchain download url for LINUX on x86_64 architecture.
is quite clear. 🤷‍♂️ If you declare depencies but forget to declare repositories it also just tells you that no repositories are defined, leaning it up to you whether you declare one directly, it apply a plugin that defines one, or ... :-)
s
What's weird is that I'm getting the same error now also from qodana-action, although I'm using setup-java before, see this.
v
Ah, you didn't mention that this is for the daemon toolchain. For that the settings plugin is useless, as you do not reach it yet. The auto-provisioning URLs for the daemon toolchain has to be in the daemon toolchain file so that auto-provisioning can be done. But yeah, as you installed the needed toolchain before, I would also expect it to work. Maybe try to run
./gradlew
before Quodana Scan to see whether that works to rule out Quodana is doing something bad.
s
Thanks, will do.
👌 1