"Unknown hardware platform: x86" when upgrading MPP plugin to 1.5.31 from 1.5.10

Not sure what else I can say, build fails immediately after changing the version number. Here is the output and my build.gradle.kts file:

Build file 'D:\Ronati\attribute-system\build.gradle.kts' line: 1

An exception occurred applying plugin request [id: 'org.jetbrains.kotlin.multiplatform', version: '1.5.31']
> Failed to apply plugin [id 'org.jetbrains.kotlin.multiplatform']
   > Unknown hardware platform: x86

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Any suggestions are appreciated!

plugins {
    kotlin("multiplatform") version "1.5.31"
    kotlin("plugin.serialization") version "1.5.10"
    application
}

val ktorVersion = "1.6.2"

group = "me.chris"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}

kotlin {
    jvm {
        compilations.all {
            kotlinOptions.jvmTarget = "1.8"
        }
        testRuns["test"].executionTask.configure {
            useJUnitPlatform()
        }
        withJava()
    }
    js(LEGACY) {
        binaries.executable()
        browser {
            commonWebpackConfig {
                cssSupport.enabled = true
            }
        }
    }
    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0")
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test"))
            }
        }
        val jvmMain by getting {
            dependencies {
                implementation("io.ktor:ktor-server-netty:$ktorVersion")
                implementation("io.ktor:ktor-html-builder:$ktorVersion")
                implementation("io.ktor:ktor-serialization:$ktorVersion")
                implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2")
                implementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.1.0")
            }
        }
        val jvmTest by getting {
            dependencies {
                runtimeOnly ("org.junit.jupiter:junit-jupiter-engine:5.8.1")
            }
        }
        val jsMain by getting {
            dependencies {
                implementation("org.jetbrains.kotlin-wrappers:kotlin-react:17.0.2-pre.206-kotlin-1.5.10")
                implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:17.0.2-pre.206-kotlin-1.5.10")
            }
        }
        val jsTest by getting {
            dependencies {
                implementation("io.github.mysticfall:kotlin-react-test:1.1.0")
            }
        }
    }
}

//application {
//    mainClass.set("ServerKt")
//}

tasks.named<Copy>("jvmProcessResources") {
    val jsBrowserDistribution = tasks.named("jsBrowserDistribution")
    from(jsBrowserDistribution)
}

tasks.named<JavaExec>("run") {
    dependsOn(tasks.named<Jar>("jvmJar"))
    classpath(tasks.named<Jar>("jvmJar"))
}

Did you make any progress? I have the same issue when updating from 1.4.30 to 1.6.0. Just like you, I even don’t target Kotlin/Native, just JS and JVM.

I have the same issue, I setup a default multiplatform project. Didn’t even add any code or make and modifications, run “gradle build” and I get the same output:

An exception occurred applying plugin request [id: ‘org.jetbrains.kotlin.multiplatform’, version: ‘1.6.10’]

Failed to apply plugin ‘org.jetbrains.kotlin.multiplatform’.
Unknown hardware platform: x86

Caused by: org.jetbrains.kotlin.konan.target.TargetSupportException: Unknown hardware platform: x86
at org.jetbrains.kotlin.konan.target.HostManager$Companion.hostArch(HostManager.kt:206)
at org.jetbrains.kotlin.konan.target.HostManager$Companion.platformName(HostManager.kt:184)

I am running Windows 10 Enterprise 64 bit, JDK 1.8.0_221-b11, Gradle 7.0.2… This is a face plant before I even get to write any code.

Any one know the issue?

This problem might be caused by the Gradle using incorrect javaHome setting.

1 Like

@Artyom.Degtyarev It worked! Thank you!