How can I build an Intel version of my mac os app?...
# compose-desktop
a
How can I build an Intel version of my mac os app? I tried including
implementation(compose.desktop.macos_x64)
in my dependencies, but when i do
./gradlew runReleaseDistributable
on my M1, the app crashes with “Failed to launch JVM”
t
To build an Intel package I am doing the following: • Use Intel jdk in compose gradle config • Set JAVA_HOME env variable to an Intel jdk before calling gradlew
That's all you need to do and because the gradle build is running using an Intel jdk for building packages you don't need to mess with the dependencies. Just use
implementation(compose.desktop.currentOs)
. Then your local debug build could still create arm builds if you use arm jdk too.
a
@Thomas I did that, but still the same ‘failed to launch JVM’. What i do is: 1. use sdkman to install a Intel jdk:
sdk use java 17.0.3-zulu
on IDEA’s terminal 2. double check that a x86_64 JDK is used. I do that by
echo $JAVA_HOME
(it prints the. path to the above zulu one) + `cat
which java
| file -` (prints
/dev/stdin: Mach-O 64-bit executable x86_64
) 3. run
./gradlew clean runReleaseDistributable
Seems like it runs the whole creating distributables, proguard etc, and in the end it fails with:
Copy code
Exception: java.lang.IllegalStateException thrown from the UncaughtExceptionHandler in thread "main"
Failed to launch JVM

> Task :desktop:runReleaseDistributable FAILED

FAILURE: Build failed with an exception.
When i do
./gradlew run
the app works. so something is probably fishy in the way i create the distributable
🤦 as always… something in proguard is causing the issue. disabling it temporarily made it the app run. PS: And creating distributables are indeed Intel. Thanks @Thomas 💯