zsmb13 / EkspenseTrakker

22 stars 1 forks source link

LibraryLoadException: Cannot find skiko-windows-x64.dll.sha256, proper native dependency missing when running on Windows #3

Open cypressious opened 2 months ago

cypressious commented 2 months ago

I've cloned the repo and run the main() function in desktopMain. After successfully building, the app crashes with the following exception at runtime:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at androidx.compose.ui.scene.skia.WindowSkiaLayerComponent.<init>(WindowSkiaLayerComponent.desktop.kt:44)
    at androidx.compose.ui.scene.ComposeContainer.createSkiaLayerComponent(ComposeContainer.desktop.kt:324)
    at androidx.compose.ui.scene.ComposeContainer.access$createSkiaLayerComponent(ComposeContainer.desktop.kt:82)
    at androidx.compose.ui.scene.ComposeContainer$mediator$2.invoke(ComposeContainer.desktop.kt:138)
    at androidx.compose.ui.scene.ComposeContainer$mediator$2.invoke(ComposeContainer.desktop.kt:138)
    at androidx.compose.ui.scene.ComposeSceneMediator$skiaLayerComponent$2.invoke(ComposeSceneMediator.desktop.kt:132)
    at androidx.compose.ui.scene.ComposeSceneMediator$skiaLayerComponent$2.invoke(ComposeSceneMediator.desktop.kt:132)
    at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    at androidx.compose.ui.scene.ComposeSceneMediator.getSkiaLayerComponent(ComposeSceneMediator.desktop.kt:132)
    at androidx.compose.ui.scene.ComposeSceneMediator.<init>(ComposeSceneMediator.desktop.kt:133)
    at androidx.compose.ui.scene.ComposeSceneMediator.<init>(ComposeSceneMediator.desktop.kt:102)
    at androidx.compose.ui.scene.ComposeContainer.<init>(ComposeContainer.desktop.kt:127)
    at androidx.compose.ui.scene.ComposeContainer.<init>(ComposeContainer.desktop.kt:82)
    at androidx.compose.ui.awt.ComposeWindowPanel.<init>(ComposeWindowPanel.desktop.kt:56)
    at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:65)
    at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:63)
    at androidx.compose.ui.window.Window_desktopKt$Window$3.invoke(Window.desktop.kt:182)
    at androidx.compose.ui.window.Window_desktopKt$Window$3.invoke(Window.desktop.kt:176)
    at androidx.compose.ui.window.Window_desktopKt$Window$10.invoke(Window.desktop.kt:409)
    at androidx.compose.ui.window.Window_desktopKt$Window$10.invoke(Window.desktop.kt:406)
    at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2.invoke(AwtWindow.desktop.kt:70)
    at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2.invoke(AwtWindow.desktop.kt:69)
    at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:82)
    at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1295)
    at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:984)
    at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1005)
    at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:1099)
    at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:633)
    at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:619)
    at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:221)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: org.jetbrains.skiko.LibraryLoadException: Cannot find skiko-windows-x64.dll.sha256, proper native dependency missing.
    at org.jetbrains.skiko.Library.findAndLoad(Library.kt:103)
    at org.jetbrains.skiko.Library.load(Library.kt:56)
    at org.jetbrains.skiko.SkiaLayer.<clinit>(SkiaLayer.awt.kt:32)
    ... 45 more
zsmb13 commented 2 months ago

If you're running from the gutter icon in IntelliJ, could be https://github.com/JetBrains/compose-multiplatform/issues/3123

cypressious commented 2 months ago

Yes. Running with Gradle gives me

Execution failed for task ':composeApp:desktopRun'. No main class specified and classpath is not an executable jar.

What's the recommended way to run it?

zsmb13 commented 2 months ago

It's ./gradlew :composeApp:run, which is the task created by the Compose Multiplatform plugin for desktop.

desktopRun not working is tracked here: https://youtrack.jetbrains.com/issue/CMP-5893/desktopRun-jvmRun-cant-be-used-to-run-Compose-Desktop-project