gluonhq / gluonfx-maven-plugin

Plugin that simplifies creating native images for Java/JavaFX maven projects
BSD 3-Clause "New" or "Revised" License
194 stars 39 forks source link

Android: Unable to Compile after Plugin Upgrade: Process compile-additional-sources failed with result: 2 #495

Open LordTylus opened 11 months ago

LordTylus commented 11 months ago

I recently updated Gluon Attach Glisten and the Maven Plugin to latest, as our App was being rejected from the Appstore for only having Api Level 31 instead of the necessary 33.

It seems to be working in our Gitlab Pipeline, but I seem to be unable to build the app locally anymore.

I am Executing the following command in my WSL: ./mvnw gluonfx:build gluonfx:package gluonfx:install gluonfx:nativerun -Pandroid

Building for iOS on my Mac works just fine.

Expected Behavior

This should build and deploy the app to my Device like it always has.

Current Behavior

However, the compilation fails. And the error message is sadly not very helpful.

Process
=======
compile-additional-sources

Command Line
============
/home/martin/.gluon/substrate/Android/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -c -DSUBSTRATE -target aarch64-linux-android -I. -fPIC -DJAVAFX_WEB -DGVM_17 -I/mnt/c/Users/m.roekker/AppData/Local/workspaces/app/target/gluonfx/aarch64-android/gvm/app dummy.c launcher.c javafx_adapter.c touch_events.c glibc_shim.c attach_adapter.c logger.c bridge_webview.c

Output
======
/home/martin/.gluon/substrate/Android/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: 1: Syntax error: word unexpected (expecting ")")

Result
======
result: 2

Steps to Reproduce

I sadly have no idea. I just updated the libraries to match the ones in the sample projects.

I also deleted the entire .gluon folder from my home directory so that everything was freshly redownloaded. And still, it did not work.

I had the same problem with GluonFX Plugin Version 1.0.21 and 1.0.20

After downgrading to 1.0.19 I get a different error which sates that: [ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.19:compile (defau lt-cli) on project app: Error: You specified an android NDK, but it does n't contain /home/martin/.gluon/substrate/Android/ndk-bundle/toolchains/llvm/prebuilt /linux-x86_64/bin/ld.lld

And going back to 1.0.16, where I originally came from, it works fine as it always has.

So my assumption is, I am doing something wrong, and sadly have no real idea how I would try to analyse it.

Your Environment

Maven Version: 3.8.7 Gluon FX Plugin Version: 1.0.22 GraalVM: 22.1.0.1-Final JavaVersion: 17

LordTylus commented 11 months ago

I had one of my collegues test it out, and for him it works just fine. Just like our BuildPipeline.

So I reckon something in my WSL is borked. I'll have to investigate further what the issue could be.

LordTylus commented 11 months ago

Hmm... I reinstalled my WSL with Ubuntu 22.4.3 Downloaded GraalVM into it set JavaHome and GraalVM home accordingly.

Execute it again and it still fails. I fail to understand why that is.

Does anyone have any idea?