Open gunnarre opened 1 month ago
Trying to use the Intel version of GraalVM did't work either:
[INFO] --- gluonfx-maven-plugin:1.0.24:compile (default-cli) @ helloscala ---
java.lang.IllegalArgumentException: We currently can't compile to aarch64-linux-android when running on x86_64-apple-darwin
at com.gluonhq.substrate.SubstrateDispatcher.getTargetConfiguration(SubstrateDispatcher.java:392)
It is not possible to build Scala apps for Android on Apple silicon Macs at the moment (as of october 2024), because Gluon Substrate doesn't support it.
Details:
I have Homebrew and XCode on the Mac from before, giving me some tools that might not be there on a fresh start.
I downloaded graalvm-java23-darwin-aarch64-gluon-23+25.1-dev from https://github.com/gluonhq/graal/releases - the regular release didn't work - you need the one forked by the Gluon project.
Unpacked to
/Library/Java/JavaVirtualMachines/graalvm-java23-darwin-aarch64-gluon-23+25.1-dev
and allowed it to run:sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-java23-darwin-aarch64-gluon-23+25.1-dev
Used Maven 3.8.8 - Maven 3.9 has a number of bugs in plugin handling (https://github.com/actions/runner-images/issues/7216) which makes it necessary to downgrade to 3.8.8. I installed Maven in a user folder.
.bash_profile settings:
Running helloscala with
mvn gluonfx:run
works with GluonFX plugin 1.0.16. Before building a native image I had to changegluonfx.maven.plugin.version
to 1.0.24 in pom.xml. Running the app natively withmvn gluonfx:build gluonfx:nativerun
then works.Unfortunately, I couldn't build it for Android, because when I run
mvn -Pandroid gluonfx:build gluonfx:package
I get the error message