Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use gluonfx-gradle-plugin in Compose for Desktop project ? #133

Open
RageshAntony opened this issue Oct 28, 2021 · 2 comments
Open

Comments

@RageshAntony
Copy link

I am trying to convert a Compose for Desktop project to native image but after adding Gradle plugin I am getting this error :

Build file '/Users/sudharsanarajalingam/RageshAntony/idea/desktopGralComp/build.gradle.kts' line: 5

An exception occurred applying plugin request [id: 'com.gluonhq.gluonfx-gradle-plugin', version: '1.0.8']

Failed to apply plugin 'com.gluonhq.gluonfx-gradle-plugin'.
Could not create task ':nativeRunAgent'.
> Could not create task of type 'NativeRunAgentTask'.
> javafxplugin:configJavafxRun task not found.

Does gluonfx support Compose for Desktop ?

my Gradle

plugins {
    kotlin("jvm") version "1.5.21"
    id("org.jetbrains.compose") version "1.0.0-alpha3"
    id ("com.gluonhq.gluonfx-gradle-plugin") version "1.0.8"
}

group = "me.sudharsanarajalingam"
version = "1.0"

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

dependencies {
    testImplementation(kotlin("test"))
    implementation(compose.desktop.currentOs)
}

tasks.test {
    useJUnitPlatform()
}

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

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

@etki
Copy link

etki commented Oct 1, 2022

For those whow will end up here via google. As found here:

If i create a clean project and only adding id 'com.gluonhq.gluonfx-gradle-plugin' version '1.0.7' then i got following error message:

Caused by: org.gradle.api.tasks.TaskInstantiationException: Could not create task of type 'NativeRunAgentTask'.
...
Caused by: org.gradle.api.GradleException: javafxplugin:configJavafxRun task not found.

i added the javafxplugin manually id 'org.openjfx.javafxplugin' version '0.0.10'

The manual inclusion of javafx plugin provided the necessary task for my gradle configuration

@mipastgt
Copy link

mipastgt commented Oct 1, 2022

What is the goal here anyway? If it is just the packaging, then you won't need this plugin because that is already integrated into the Compose Gradle plugin. If it is about creating a binary executable, then this will probably not work anyway because Compose for desktop needs AWT and that is not yet fully supported by GraalVM/native-image and there is an issue with the loading of the SKIA library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants