0

Ive been trying to create an apk file for my gluon project. On windows and for windows, the prroject runs perfectly but when in Ubuntu, the commands mvn -Pandroid gluonfx:runagent will run the project but the project wont compile and build.

the error I get keep getting is:

[Wed Jan 04 15:32:35 IST 2023][INFO] We will now compile your code for aarch64-linux-android. This may take some time.[Wed Jan 04 15:33:01 IST 2023][INFO] Additional information: Objectfile should be called com.gluonapplication.mobiletrial1.o but we didn't find that under /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm[Wed Jan 04 15:33:01 IST 2023][SEVERE] Compiling failed.Check the log files under /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/logAnd please check https://docs.gluonhq.com/ for more information.[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time:  45.283 s[INFO] Finished at: 2023-01-04T15:33:01+05:30[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.15:compile (default-cli) on project mobiletrial1: Compiling failed -> [Help 1]

The log file

[Wed Jan 04 16:48:54 IST 2023][FINE] PB Command for compile: /mnt/c/Java/linux/graalvm-svm-java17-linux-gluon-22.1.0.1-Final/bin/native-image -Djdk.internal.lambda.eagerlyInitialize=false --no-server -H:+SharedLibrary -H:+AddAllCharsets -H:+ReportExceptionStackTraces -H:-DeadlockWatchdogExitOnTimeout -H:DeadlockWatchdogInterval=0 -H:+RemoveSaturatedTypeFlows -H:+ExitAfterRelocatableImageWrite --features=org.graalvm.home.HomeFinderFeature -H:TempDirectory=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/tmp -H:EnableURLProtocols=http,https --initialize-at-build-time=com.gluonhq.charm.glisten.visual.MaterialDesignIcon -H:ReflectionConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/reflectionconfig-aarch64-android.json -H:JNIConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/jniconfig-aarch64-android.json -H:ResourceConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/resourceconfig-aarch64-android.json -H:-SpawnIsolates -Dsvm.targetArch=aarch64 -H:+ForceNoROSectionRelocations --libc=bionic -H:+UseCAPCache -H:CAPCacheDir=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/capcache -H:CompilerBackend=lir -H:IncludeResourceBundles=com/sun/javafx/scene/control/skin/resources/controls,com/sun/javafx/scene/control/skin/resources/controls-nt,com.sun.javafx.tk.quantum.QuantumMessagesBundle -Dsvm.platform=org.graalvm.nativeimage.Platform$LINUX_AARCH64 -cp /home/vatsal/.m2/repository/com/gluonhq/substrate/0.0.55/substrate-0.0.55.jar:/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/tmp/classpathJar.jar com.gluonapplication.MobileTrial1
[Wed Jan 04 16:48:54 IST 2023][FINE] Start process compile...
[Wed Jan 04 16:48:54 IST 2023][FINE] Result for compile: 0
[Wed Jan 04 16:48:54 IST 2023][FINE] Logging process [compile] to file: /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/log/process-compile-1672831134641.log
[Wed Jan 04 16:48:54 IST 2023][INFO] Additional information: Objectfile should be called com.gluonapplication.mobiletrial1.o but we didn't find that under /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm
[Wed Jan 04 16:48:54 IST 2023][SEVERE] Compiling failed.
Check the log files under /mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/aarch64-android/gvm/log
And please check https://docs.gluonhq.com/ for more information.

gluonfx log file

Process
=======
compile

Command Line
============
/mnt/c/Java/linux/graalvm-svm-java17-linux-gluon-22.1.0.1-Final/bin/native-image -Djdk.internal.lambda.eagerlyInitialize=false --no-server -H:+SharedLibrary -H:+AddAllCharsets -H:+ReportExceptionStackTraces -H:-DeadlockWatchdogExitOnTimeout -H:DeadlockWatchdogInterval=0 -H:+RemoveSaturatedTypeFlows -H:+ExitAfterRelocatableImageWrite --features=org.graalvm.home.HomeFinderFeature --features=com.gluonhq.substrate.feature.GluonFeature -H:TempDirectory=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/tmp -H:EnableURLProtocols=http,https -H:ReflectionConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/reflectionconfig-x86_64-linux.json -H:JNIConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/jniconfig-x86_64-linux.json -H:ResourceConfigurationFiles=/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/resourceconfig-x86_64-linux.json -H:IncludeResourceBundles=com/sun/javafx/scene/control/skin/resources/controls,com/sun/javafx/scene/control/skin/resources/controls-nt,com.sun.javafx.tk.quantum.QuantumMessagesBundle -Dsvm.platform=org.graalvm.nativeimage.Platform$LINUX_AMD64 -cp /home/vatsal/.m2/repository/com/gluonhq/substrate/0.0.55/substrate-0.0.55.jar:/mnt/g/Intellij_Projects/MobileTrial1/target/gluonfx/x86_64-linux/gvm/tmp/classpathJar.jar com.gluonapplication.MobileTrial1

Output
======


Result
======
result: 0

I have tried uninstalling and reinstalling ubuntu and wsl and I have tried the same process on Linux and have got the same error.

  • @José Pereda Please help me out – vatsal shah Jan 04 '23 at 10:11
  • You'll need to post more details. The log files under `target/gluonfx/aarch64-android/gvm/log` and `target/gluonfx/log` are a good place to start looking for an exception... Post what you find relevant? – José Pereda Jan 04 '23 at 10:24
  • @José Pereda logs added – vatsal shah Jan 04 '23 at 12:46
  • Weird, compilation time is 0, so something went wrong. Can you post as well `target/gluonfx/log/process-compile-1672831134641.log`? – José Pereda Jan 04 '23 at 13:08
  • What happens if you copy the command line from the log file and run it directly on a terminal? – José Pereda Jan 04 '23 at 15:27
  • Same Error. I've tried finding the .o file as well. Tried to compile the project on my friends linux machine and got the same error – vatsal shah Jan 05 '23 at 05:29
  • On windows system, it just says that android cannot be compiled on windows system. And I've been getting the same error on WSL2 Ubuntu and linux – vatsal shah Jan 05 '23 at 05:30
  • Something sounds off here. Have you tried simply running (on WSL2) `mvn gluonfx:run`, even if there is no UI and it won't fully run? `gluonfx:compile` should do _something_ and at least start the compilation and throw an exception at some point. Also, if you run on a Linux machine, it should fully work. If it doesn't, let's start there... – José Pereda Jan 05 '23 at 08:56
  • it program runs on linux and windows but not with android – vatsal shah Jan 05 '23 at 18:42
  • If you run the native-image command line from a WSL2 terminal again, it should give you some indication that is failing. Also it is not possible that it finishes in 0 seconds. So there must be some error message about it. You can add to that command line verbose flags. like: `--verbose -DGVM_VERBOSE`. Can you try again and post the result? – José Pereda Jan 05 '23 at 18:50
  • Hey I reset my pc and tried everything from the start. Now the project is compiling but it is giving error for 'mvn gluonfx:link'. The error is 'com.technow.sample.main.obj : error LNK2001: unresolved external symbol Java_jdk_net_WindowsSocketOptions_get IpDontFragment0' && '[SEVERE] Process link failed with result: 1120'. Stuck – vatsal shah Jan 06 '23 at 19:56
  • Hmm, that symbol can be found in [WindowsSocketOptions.c](https://github.com/openjdk/jdk/blob/master/src/jdk.net/windows/native/libextnet/WindowsSocketOptions.c#L79) which is a _Windows_ specific file. Under Linux/WSL2 your project shouldn't include such dependencies. Make sure you have the correct JDK for Linux (or simply point to the GraalVM path)? – José Pereda Jan 06 '23 at 20:18

0 Answers0