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

Not possible to build on Apple silicon at the moment #21

Open
gunnarre opened this issue Oct 14, 2024 · 1 comment
Open

Not possible to build on Apple silicon at the moment #21

gunnarre opened this issue Oct 14, 2024 · 1 comment

Comments

@gunnarre
Copy link

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 (actions/runner-images#7216) which makes it necessary to downgrade to 3.8.8. I installed Maven in a user folder.

.bash_profile settings:

export GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-java23-darwin-aarch64-gluon-23+25.1-dev/Contents/Home
export JAVA_HOME=$GRAALVM_HOME
export PATH=$GRAALVM_HOME/bin:$PATH
export PATH=[yourpathhere]/apache-maven-3.8.8/bin:$PATH

Running helloscala with mvn gluonfx:run works with GluonFX plugin 1.0.16. Before building a native image I had to change gluonfx.maven.plugin.version to 1.0.24 in pom.xml. Running the app natively with mvn 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

java.lang.IllegalArgumentException: We currently can't compile to aarch64-linux-android when running on aarch64-apple-darwin
	at com.gluonhq.substrate.SubstrateDispatcher.getTargetConfiguration(SubstrateDispatcher.java:392)
@gunnarre
Copy link
Author

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)

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

1 participant