{"record":{"id":"1bab3008438b79e1","repo":"gradle/gradle","slug":"unsupported-host-for-s","errorCode":null,"errorMessage":"Unsupported host for %s","messagePattern":"Unsupported host for (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"platforms/native/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/msvcpp/WindowsKitSdkInstall.java","lineNumber":55,"sourceCode":"        this.binDir = binDir;\n        this.systemInfo = systemInfo;\n    }\n\n    @Override\n    public WindowsSdk forPlatform(final NativePlatformInternal platform) {\n        String host;\n        switch (systemInfo.getArchitecture()) {\n            case i386:\n                host = \"x86\";\n                break;\n            case amd64:\n                host = \"x64\";\n                break;\n            case aarch64:\n                host = \"arm64\";\n                break;\n            default:\n                throw new UnsupportedOperationException(String.format(\"Unsupported host for %s\", toString()));\n        }\n\n        if (platform.getArchitecture().isAmd64()) {\n            return new WindowsKitBackedSdk(\"x64\", host);\n        }\n        if (platform.getArchitecture().isArm64()) {\n            return new WindowsKitBackedSdk(\"arm64\", host);\n        }\n        if (platform.getArchitecture().isArm32()) {\n            return new WindowsKitBackedSdk(\"arm\", host);\n        }\n        if (platform.getArchitecture().isI386()) {\n            return new WindowsKitBackedSdk(\"x86\", host);\n        }\n        throw new UnsupportedOperationException(String.format(\"Unsupported %s for %s.\", platform.getArchitecture().getDisplayName(), toString()));\n    }\n\n    private class WindowsKitBackedSdk implements WindowsSdk {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/gradle/gradle/blob/534f27719b66953f95cc907aae7f2c1b12f5482d/platforms/native/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/msvcpp/WindowsKitSdkInstall.java#L37-L73","documentation":"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.","triggerScenarios":"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.","commonSituations":"Exotic host platforms running JVM builds; early-adopter ARM Windows machines with JVMs reporting unexpected os.arch values; emulation environments reporting unusual architectures.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"def hostArch = System.getProperty('os.arch')\ndef supportedHosts = ['x86', 'amd64', 'aarch64']\nif (org.gradle.internal.os.OperatingSystem.current().windows && !(hostArch in supportedHosts)) {\n    throw new GradleException(\"Windows Kit resolution unsupported on host arch ${hostArch}; supported: $supportedHosts\")\n}","typeGuard":"def isSupportedWindowsKitHost = { arch -> ['x86', 'amd64', 'aarch64'].contains(arch) }","tryCatchPattern":null,"preventionTips":["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."],"tags":["gradle","windows-kit","host-architecture","unsupported","native"],"backgroundTag":"unsupported-host-architecture","analyzedSha":"534f27719b66953f95cc907aae7f2c1b12f5482d","analyzedAt":"2026-08-22T08:09:12.375Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}