JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.72k stars 1.14k forks source link

PackagingExe fails on Windows #1920

Open talhatek opened 2 years ago

talhatek commented 2 years ago

I am running 'gradle task packageExe' and it fails:

External tool execution failed:
* Command: [C:\Users\pc\Downloads\openjdk-15_windows-x64_bin\jdk-15\bin\jpackage.exe, @C:\Users\pc\Downloads\Holvi\build\compose\tmp\packageExe.args.txt]
* Working dir: []
* Exit code: 1
* Standard output log: C:\Users\pc\Downloads\Holvi\build\compose\logs\packageExe\jpackage-2022-03-02-02-31-17-out.txt
* Error log: C:\Users\pc\Downloads\Holvi\build\compose\logs\packageExe\jpackage-2022-03-02-02-31-17-err.txt

And here is the err.txt :

java.io.IOException: Command [candle.exe, -nologo, C:\Users\pc\AppData\Local\Temp\jdk.jpackage16205732775025240471\config\bundle.wxf, -ext, WixUtilExtension, -arch, x64, -out, C:\Users\pc\AppData\Local\Temp\jdk.jpackage16205732775025240471\wixobj\bundle.wixobj] in C:\Users\pc\AppData\Local\Temp\jdk.jpackage16205732775025240471\images\win-msi.image\Holvi exited with 14 code

I have already added C:\Program Files (x86)\WiX Toolset v3.11\bin to path variables.

Lastly build.gradle :

plugins {
    kotlin("jvm") version "1.5.31"
    id("org.jetbrains.compose") version "1.0.0"
}

group = "me.pc"
version = "1.0"

repositories {
    google()
    mavenCentral()
    maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}

dependencies {
    implementation(compose.desktop.currentOs)
    implementation("org.yaml:snakeyaml:1.29")
    implementation("com.arkivanov.decompose:decompose:0.5.1")
    implementation("com.arkivanov.decompose:extensions-compose-jetbrains:0.5.1")
}

tasks.withType<KotlinCompile> {
    kotlinOptions{
        jvmTarget = "15"
        freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
    }
}

compose.desktop {
    application {
        mainClass = "MainKt"
        nativeDistributions {
            targetFormats(TargetFormat.Dmg,TargetFormat.Msi,TargetFormat.Deb,TargetFormat.Exe)
            packageName = "Holvi"
            packageVersion = "1.0.0"
        }
    }
} 

Any solutions ?

brandon3343 commented 2 years ago

use java16 instead of java15

talhatek commented 2 years ago

I have tried java 16 as well. Unfortunately same error occurs.

akurasov commented 2 years ago

The error is returned by JPackage. What is the issue for it?

VincentJ1989 commented 2 years ago

U can check your gradle version and jdk version from the gradle official document . Here is the link :Gradle

okushnikov commented 1 month ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.