gluonhq / gluonfx-gradle-plugin

Plugin that simplifies using Gluon Client for Java/JavaFX gradle projects
BSD 3-Clause "New" or "Revised" License
100 stars 22 forks source link

Unsupported JavaFX configuration: classes were loaded from 'unnamed module @48140564' on nativeRun (Windows) #167

Open realkarmakun opened 2 years ago

realkarmakun commented 2 years ago

I'm using https://github.com/gluonhq/graal/releases build.gradle: https://gist.github.com/realkarmakun/b4efcaa87c65700524e64b725b9c1e82

Build goes through just fine, the run fails though, to me it looks like for some reason JavaFX modules are missing in runtime (Most likely I missed something when setting up project, since sample projects using IDEA plugin with gradle fail as well) I can provide full project if needed. Not sure what exactly is wrong here. App runs just fine using plain JVM from IDE.

Logs of running nativeRun:

C:\Users\karma\IdeaProjects\rustmelauncher>gradlew.bat nativeRun

> Configure project :
Project : => 'ru.meproject.rustmelauncher' Java module
[тЄ эю с. 01 18:02:37 OMST 2022][INFO] [SUB] эю с. 01, 2022 6:02:37 PM com.sun.javafx.application.PlatformImpl startup
[тЄ эю с. 01 18:02:37 OMST 2022][INFO] [SUB] WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @48140564'

> Task :nativeRun
[тЄ эю с. 01 18:02:37 OMST 2022][INFO] ==================== RUN TASK ====================
[тЄ эю с. 01 18:02:40 OMST 2022][SEVERE] Process run until end failed with result: -1073741819
Check the log files under C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\x86_64-windows\gvm\log
And please check https://docs.gluonhq.com/ for more information.
[тЄ эю с. 01 18:02:40 OMST 2022][INFO] Logging process [run until end] to file: C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\log\process-run until end-1667304160042.log

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 3s
3 actionable tasks: 1 executed, 2 up-to-date

Logs of nativeBuild:

C:\Users\karma\IdeaProjects\rustmelauncher>gradlew.bat nativeBuild

> Configure project :
Project : => 'ru.meproject.rustmelauncher' Java module
[тЄ эю с. 01 18:01:07 OMST 2022][INFO] [SUB] Warning: Ignoring server-mode native-image argument --no-server.

> Task :nativeCompile
[тЄ эю с. 01 18:01:06 OMST 2022][INFO] ==================== COMPILE TASK ====================
[тЄ эю с. 01 18:01:06 OMST 2022][INFO] We will now compile your code for x86_64-microsoft-windows. This may take some time.

[тЄ эю с. 01 18:01:10 OMST 2022][INFO] [SUB] ========================================================================================================================
[тЄ эю с. 01 18:01:10 OMST 2022][INFO] [SUB] GraalVM Native Image: Generating 'ru.meproject.rustmelauncher.runtimestart' (shared library)...
[тЄ эю с. 01 18:01:10 OMST 2022][INFO] [SUB] ========================================================================================================================
[тЄ эю с. 01 18:01:13 OMST 2022][INFO] [SUB] [1/7] Initializing...                                                                                    (4,5s @ 0,14GB)
[тЄ эю с. 01 18:01:13 OMST 2022][INFO] [SUB]  Version info: 'GraalVM 22.1.0.1 Java 17 CE'
[тЄ эю с. 01 18:01:13 OMST 2022][INFO] [SUB]  C compiler: cl.exe (microsoft, x64, 19.33.31630)
[тЄ эю с. 01 18:01:13 OMST 2022][INFO] [SUB]  Garbage collector: Serial GC
[тЄ эю с. 01 18:01:47 OMST 2022][INFO] [SUB] [2/7] Performing analysis...  [**************]                                                          (34,1s @ 3,72GB)
[тЄ эю с. 01 18:01:47 OMST 2022][INFO] [SUB]   11а437 (90,59%) of 12а625 classes reachable
[тЄ эю с. 01 18:01:47 OMST 2022][INFO] [SUB]   20а354 (66,27%) of 30а714 fields reachable
[тЄ эю с. 01 18:01:47 OMST 2022][INFO] [SUB]   56а457 (64,78%) of 87а158 methods reachable
[тЄ эю с. 01 18:01:47 OMST 2022][INFO] [SUB]      655 classes,   179 fields, and 2а024 methods registered for reflection
[тЄ эю с. 01 18:01:47 OMST 2022][INFO] [SUB]      134 classes,   150 fields, and   206 methods registered for JNI access
[тЄ эю с. 01 18:01:49 OMST 2022][INFO] [SUB] [3/7] Building universe...                                                                               (2,4s @ 2,04GB)
[тЄ эю с. 01 18:01:51 OMST 2022][INFO] [SUB] [4/7] Parsing methods...      [*]                                                                        (1,5s @ 3,19GB)
[тЄ эю с. 01 18:01:55 OMST 2022][INFO] [SUB] [5/7] Inlining methods...     [****]                                                                     (3,6s @ 1,23GB)
[тЄ эю с. 01 18:02:17 OMST 2022][INFO] [SUB] [6/7] Compiling methods...    [*****]                                                                   (21,9s @ 2,44GB)
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB]
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB] ------------------------------------------------------------------------------------------------------------------------
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB]                         6,5s (8,5% of total time) in 35 GCs | Peak RSS: 6,48GB | CPU load: 4,29
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB] ------------------------------------------------------------------------------------------------------------------------
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB] Produced artifacts:
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB]  C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\x86_64-windows\gvm\rustmelauncher\graal_isolate.h (header)
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB]  C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\x86_64-windows\gvm\rustmelauncher\ru.meproject.rustmelauncher.runtimestart.h (header)
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB]  C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\x86_64-windows\gvm\rustmelauncher\graal_isolate_dynamic.h (header)
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB]  C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\x86_64-windows\gvm\rustmelauncher\ru.meproject.rustmelauncher.runtimestart_dynamic.h (header)
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB]  C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\x86_64-windows\gvm\rustmelauncher\ru.meproject.rustmelauncher.runtimestart.build_artifacts.txt
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB] ========================================================================================================================
[тЄ эю с. 01 18:02:24 OMST 2022][INFO] [SUB] Finished generating 'ru.meproject.rustmelauncher.runtimestart' in 1m 15s.
[тЄ эю с. 01 18:02:25 OMST 2022][INFO] [SUB] Microsoft (R) Incremental Linker Version 14.33.31630.0
[тЄ эю с. 01 18:02:25 OMST 2022][INFO] [SUB] Copyright (C) Microsoft Corporation.  All rights reserved.
[тЄ эю с. 01 18:02:25 OMST 2022][INFO] [SUB]
[тЄ эю с. 01 18:02:25 OMST 2022][INFO] [SUB]    Создается библиотека C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\x86_64-windows\rustmelauncher.lib и объект C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\x86_64-windows\rustmelauncher.exp

> Task :nativeLink
[тЄ эю с. 01 18:02:25 OMST 2022][INFO] ==================== LINK TASK ====================
[тЄ эю с. 01 18:02:25 OMST 2022][INFO] Default icon.ico image generated in C:\Users\karma\IdeaProjects\rustmelauncher\build\gluonfx\x86_64-windows\gensrc\windows\assets.
Consider copying it to C:\Users\karma\IdeaProjects\rustmelauncher\src\windows before performing any modification

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1m 20s
5 actionable tasks: 3 executed, 2 up-to-date
realkarmakun commented 2 years ago

Okay I believe this can be solved by https://github.com/gluonhq/gluonfx-gradle-plugin/pull/159 Is there a snapshot that can be used at the moment?

realkarmakun commented 2 years ago

Alright. I cross compared gradle and maven plugin using HelloFXML project created using Gluon IDEA plugin. Run on gradle failes but maven works just fine. A few points I'd like to make clear:

  1. I used Gluon GraalVM 22.1.0.1-Final both on maven and gradle projects
  2. Gradle nedded an update to 7.2 since default gradle config made by plugin include version 6.4 which doesn't support Java 17

I also tried building plugin version from the Pull Request - didn't work, same error on nativeRun Guess this issue originates not from my setup, but a gradle plugin itself 😢

realkarmakun commented 2 years ago

This is still very much relevant, gradle plugin litrally doesn't work on my end