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

  1. Run the build on a supported host architecture (x86, x64, arm64) - this is a host-side constraint, not a target one.
  2. Upgrade Gradle, which may add host mappings for new architectures.
  3. 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

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


AI-assisted analysis of gradle/gradle@534f27719b (2026-08-22). Data as JSON: /api/errors/1bab3008438b79e1. Report an issue: GitHub.