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.92k stars 1.16k forks source link

The result of packageDmg can't start, error msg is : LSOpenURLsWithRole() failed with error -10810 #848

Open RubiTree opened 3 years ago

RubiTree commented 3 years ago

I use default scrip to packageDmg, and i get a dmg, i double click this dmg and move the app to /Applications dir But i can't start this app and see msg is: LSOpenURLsWithRole() failed with error -10810

Then I give permissions like this, but the error msg is the same.

I don't know if the reason is i don't signed the application, but i have open mac install condition by use sudo spctl --master-disable I don't have an developer account and I will try to apply it to sign the app later.

Here is my build.gradle scrip, and I can afford more informations if needs.

import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm") version "1.4.30"
    id("org.jetbrains.compose") version "0.3.1"
}

group = "me.bear"
version = "1.0"

repositories {
    jcenter()
    mavenCentral()
    maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
}

dependencies {
    testImplementation(kotlin("test-junit"))
    implementation(compose.desktop.currentOs)
    implementation("org.eclipse.jgit:org.eclipse.jgit:3.5.0.201409260305-r")
}

tasks.test {
    useJUnit()
}

tasks.withType<KotlinCompile>() {
    kotlinOptions.jvmTarget = "11"
}

compose.desktop {
    application {
        mainClass = "MainKt"
        nativeDistributions {
            targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
            packageName = "XXX"
            packageVersion = "1.0.0"
        }
    }
}
AlexeyTsvetkov commented 3 years ago

@RubiTree so far I can't reproduce the issue. Does the issue reproduces with the default template? E.g. your build config + the following source:

// Main.kt
fun main() = Window {
    var text by remember { mutableStateOf("Hello, World!") }

    MaterialTheme {
        Button(onClick = {
            text = "Hello, Desktop!"
        }) {
            Text(text)
        }
    }
}

What version of macOS, xcode and Java do you use?

okushnikov commented 2 months ago

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