https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
t

Tobias

12/05/2023, 5:09 PM
Beginner's question - Getting error:
'long org.jetbrains.skiko.MetalApiKt.chooseAdapter(int)''
1
Hi teams, thanks providing such a first citizen theme for the desktop! Awesome! I ran the standalone-sample and it worked, now I try to create my very own sample and I get the error from the thread title. That means, that I missed something and the mistake is on my side, but I cannot find the reason for that. I'm running IntelliJ IDEA Community in an M2 MacBook Pro. I already asked in #jewel but I was prompted to use this channel.
a

Alexander Maryanovsky

12/05/2023, 6:02 PM
Where are you getting this error?
t

Tobias

12/05/2023, 6:08 PM
During the launch using IntelliJ. Snippet of the stacktrace:
Copy code
/Users/tscholze/Library/Java/JavaVirtualMachines/jbr-17.0.8.1/Contents/Home/bin/java -javaagent:/Users/tscholze/Applications/IntelliJ IDEA Community <http://Edition.app/Contents/lib/idea_rt.jar=62981:/Users/tscholze/Applications/IntelliJ|Edition.app/Contents/lib/idea_rt.jar=62981:/Users/tscholze/Applications/IntelliJ> IDEA Community <http://Edition.app/Contents/bin|Edition.app/Contents/bin> -Dfile.encoding=UTF-8 -classpath /Users/tscholze/Code/__me/Kotlog/build/classes/kotlin/main:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.jewel/jewel-int-ui-decorated-window/0.11.0/62b458e238669b8007ddc7d6feabbfde69e6ac64/jewel-int-ui-decorated-window-0.11.0.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.jewel/jewel-int-ui-standalone/0.11.0/d32335ddc274f10e29f926f1bbe34daa1b1af2c6/jewel-int-ui-standalone-0.11.0.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.jewel/jewel-decorated-window/0.11.0/90e3bad930e191a4ddb162a54fb5e6ec793662f4/jewel-decorated-window-0.11.0.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.jewel/jewel-ui/0.11.0/78011a93301b2acc51ad016f23c32b6e30ccdd66/jewel-ui-0.11.0.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.foundation/foundation-desktop/1.5.11/8ed7fbae30be5411f111572ee7a5929622606152/foundation-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.jewel/jewel-foundation/0.11.0/addef7c0af6058d9a88e5cc5d530d581f024fcfb/jewel-foundation-0.11.0.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.desktop/desktop-jvm/1.4.1/922ebea5ab9e202ee66ab4f4f567a74184eddbc1/desktop-jvm-1.4.1.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.animation/animation-desktop/1.5.11/f1cbe23da9ecb37aa6b2b3e57b223327227b910a/animation-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.ui/ui-desktop/1.5.11/22fe2fbeb2c34870a5fb9c655228db97ee14cae1/ui-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.skiko/skiko-awt/0.7.85.4/6075ef19e023a3b96cee73ea791cdc6858cb892e/skiko-awt-0.7.85.4.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.runtime/runtime-desktop/1.5.11/b73456ee05b2ed483fbcf4796a5ccc871577f430/runtime-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.ui/ui-tooling-preview-desktop/1.4.1/16e8e3a0dd0d52b5e4877a54bc345668ba23428d/ui-tooling-preview-desktop-1.4.1.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.foundation/foundation-layout-desktop/1.5.11/df30b80d1cc669e37290284ee3f27f27c3658e9f/foundation-layout-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.animation/animation-core-desktop/1.5.11/c9cbe3824dd25e0152e9298574d24ec9ac61d016/animation-core-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.ui/ui-geometry-desktop/1.5.11/81ea1ab414ba9926972708e9f4ca7ac499cd9137/ui-geometry-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.ui/ui-text-desktop/1.5.11/44519ce6b5b12b70308746ed4351664fdf428322/ui-text-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.ui/ui-graphics-desktop/1.5.11/694e3a460d5fc15245b2502ae4025113f132abb2/ui-graphics-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.runtime/runtime-saveable-desktop/1.5.11/7afa940f340c1432bf95466463cdc00baa6e63eb/runtime-saveable-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.ui/ui-unit-desktop/1.5.11/ce79e803d4f0b33631c958f64ff36a7010580d16/ui-unit-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.8.21/67f57e154437cd9e6e9cf368394b95814836ff88/kotlin-stdlib-jdk8-1.8.21.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.skiko/skiko-awt-runtime-macos-arm64/0.7.63/ba54c3c3c9f8cd6c88c0b2ee431e856beb1c5978/skiko-awt-runtime-macos-arm64-0.7.63.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.8.21/7473b8cd3c0ef9932345baf569bc398e8a717046/kotlin-stdlib-jdk7-1.8.21.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.21/43d50ab85bc7587adfe3dda3dbe579e5f8d51265/kotlin-stdlib-1.8.21.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/5.13.0/1200e7ebeedbe0d10062093f32925a912020e747/jna-5.13.0.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.21/d749cd5ae25da36d06e5028785038e24f9d37976/kotlin-stdlib-common-1.8.21.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/23.0.0/8cc20c07506ec18e0834947b84a864bfc094484e/annotations-23.0.0.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm/1.7.3/2b09627576f0989a436a00a4a54b55fa5026fb86/kotlinx-coroutines-core-jvm-1.7.3.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.compose.ui/ui-util-desktop/1.5.11/b6cef817ffe7a8b7bba1ef34ded701f287cebf9/ui-util-desktop-1.5.11.jar:/Users/tscholze/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-jvm/0.17.0/d3d2e380b6ee28231118101d09ae6dd06a1db1cb/atomicfu-jvm-0.17.0.jar MainKt
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'long org.jetbrains.skiko.MetalApiKt.chooseAdapter(int)'
	at org.jetbrains.skiko.MetalApiKt.chooseAdapter(Native Method)
	at org.jetbrains.skiko.MetalApiKt.chooseMetalAdapter(MetalApi.kt:12)
	at org.jetbrains.skiko.redrawer.MetalRedrawer.<init>(MetalRedrawer.kt:62)
	at org.jetbrains.skiko.Actuals_awtKt$makeDefaultRenderFactory$1.createRedrawer(Actuals.awt.kt:26)
	at org.jetbrains.skiko.SkiaLayer$redrawerManager$1.invoke(SkiaLayer.awt.kt:304)
	at org.jetbrains.skiko.SkiaLayer$redrawerManager$1.invoke(SkiaLayer.awt.kt:302)
	at org.jetbrains.skiko.redrawer.RedrawerManager.findNextWorkingRenderApi(RedrawerManager.kt:31)
a

Alexander Maryanovsky

12/05/2023, 6:10 PM
Does an empty
singleWindowApplication
also crash?
t

Tobias

12/05/2023, 6:12 PM
yes with the same error
I lso tried to use in this if:
Copy code
implementation(compose.desktop.macos_arm64) {
        exclude(group = "org.jetbrains.compose.material")
    }
.currentOS
but this also has no affect
a

Alexander Maryanovsky

12/05/2023, 6:23 PM
What computer are you running?
And what is your compose version?
And does it work if you run it with gradle instead of from the IDE?
t

Tobias

12/05/2023, 6:33 PM
@Alexander Maryanovsky ah good point, I just run the IntelliJ wizard, but the compose version was quite old. I updated it and now it builds. Thanks!
👍 1
It was 1.4.x
Thanks for helping me 🤗
a

Alexander Maryanovsky

12/05/2023, 6:40 PM
You’re welcome
2 Views