gradle/gradle · error · UnsupportedOperationException
Unsupported host for %s
Error message
Unsupported host for %s
What it means
WindowsKitSdkInstall first maps the HOST machine's architecture (from OperatingSystem/FileSystemDetails systemInfo) to the Windows Kit host directory name: i386->x86, amd64->x64, aarch64->arm64. Running Gradle itself on any other host architecture throws UnsupportedOperationException 'Unsupported host for <install>' before target selection even happens.
Source
Thrown at platforms/native/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/msvcpp/WindowsKitSdkInstall.java:55
this.binDir = binDir;
this.systemInfo = systemInfo;
}
@Override
public WindowsSdk forPlatform(final NativePlatformInternal platform) {
String host;
switch (systemInfo.getArchitecture()) {
case i386:
host = "x86";
break;
case amd64:
host = "x64";
break;
case aarch64:
host = "arm64";
break;
default:
throw new UnsupportedOperationException(String.format("Unsupported host for %s", toString()));
}
if (platform.getArchitecture().isAmd64()) {
return new WindowsKitBackedSdk("x64", host);
}
if (platform.getArchitecture().isArm64()) {
return new WindowsKitBackedSdk("arm64", host);
}
if (platform.getArchitecture().isArm32()) {
return new WindowsKitBackedSdk("arm", host);
}
if (platform.getArchitecture().isI386()) {
return new WindowsKitBackedSdk("x86", host);
}
throw new UnsupportedOperationException(String.format("Unsupported %s for %s.", platform.getArchitecture().getDisplayName(), toString()));
}
private class WindowsKitBackedSdk implements WindowsSdk {View on GitHub (pinned to 534f27719b)
Solutions
- Run the build on a supported host architecture (x86, x64, arm64) - this is a host-side constraint, not a target one.
- Upgrade Gradle, which may add host mappings for new architectures.
- If you control the JVM, check what os.arch it reports; a misreporting JVM can trigger this.
Defensive patterns
Strategy: validation
Validate before calling
def hostArch = System.getProperty('os.arch')
def supportedHosts = ['x86', 'amd64', 'aarch64']
if (org.gradle.internal.os.OperatingSystem.current().windows && !(hostArch in supportedHosts)) {
throw new GradleException("Windows Kit resolution unsupported on host arch ${hostArch}; supported: $supportedHosts")
} Type guard
def isSupportedWindowsKitHost = { arch -> ['x86', 'amd64', 'aarch64'].contains(arch) } Prevention
- Run Gradle on x86, x64 or arm64 hosts when Windows Kit SDKs are involved.
- Verify os.arch of the JVM doing the build - it is the host input, not the target.
- Treat this as an environment constraint: no build-script change can widen the host map.
When it happens
Trigger: Executing the JVM/Gradle on a host whose os.arch is not i386, amd64 or aarch64 - e.g. an experimental RISC-V or PPC Windows/Linux port - while a Windows Kit SDK install is being resolved.
Common situations: Exotic host platforms running JVM builds; early-adopter ARM Windows machines with JVMs reporting unexpected os.arch values; emulation environments reporting unusual architectures.
Related errors
- Unsupported %s for %s.
- Unsupported %s for %s.
- Unable to get system memory
- Unable to get system memory
- The C++ library plugin currently requires exactly one public
AI-assisted analysis of gradle/gradle@534f27719b (2026-08-22).
Data as JSON: /api/errors/1bab3008438b79e1.
Report an issue: GitHub.