JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.23k stars 1.18k forks source link

SplitPane demo crashes with maven dependency #2479

Closed JonZarate closed 1 month ago

JonZarate commented 1 year ago

My program was crashing at startup when trying to add a HorizontalSplitPane. In my troubleshooting I replaced the dependency the demo sample project had on the library and replaced it.

From this:

implementation(project(":SplitPane:library"))

to:

implementation("org.jetbrains.compose.components:components-splitpane-desktop:1.2.0")

Now the demo app crashes as well:

Exception in thread "main" java.lang.NoSuchMethodError: 'void org.jetbrains.skiko.SkiaLayer.<init>(kotlin.jvm.functions.Function1, boolean, boolean, org.jetbrains.skiko.GraphicsApi, org.jetbrains.skiko.SkiaLayerAnalytics, int, kotlin.jvm.internal.DefaultConstructorMarker)'
    at androidx.compose.ui.awt.ComposeLayer$ComponentImpl.<init>(ComposeLayer.desktop.kt:205)
    at androidx.compose.ui.awt.ComposeLayer.<init>(ComposeLayer.desktop.kt:90)
    at androidx.compose.ui.awt.ComposeWindowDelegate.<init>(ComposeWindowDelegate.desktop.kt:54)
    at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:61)
    at androidx.compose.ui.awt.ComposeWindow.<init>(ComposeWindow.desktop.kt:59)
    at androidx.compose.ui.window.Window_desktopKt$Window$3.invoke(Window.desktop.kt:162)
    at androidx.compose.ui.window.Window_desktopKt$Window$3.invoke(Window.desktop.kt:156)
    at androidx.compose.ui.window.Window_desktopKt$Window$10$1.invoke(Window.desktop.kt:378)
    at androidx.compose.ui.window.Window_desktopKt$Window$10$1.invoke(Window.desktop.kt:377)
    at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2.invoke(AwtWindow.desktop.kt:75)
    at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$2.invoke(AwtWindow.desktop.kt:74)
    at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:81)
    at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1032)
    at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:793)
    at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:813)
    at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:827)
    at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:519)
    at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:219)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

This is the crash on my software:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 'long org.jetbrains.skiko.redrawer.Direct3DRedrawer.chooseAdapter(int)'
    at org.jetbrains.skiko.redrawer.Direct3DRedrawer.chooseAdapter(Native Method)
    at org.jetbrains.skiko.redrawer.Direct3DRedrawer.<init>(Direct3DRedrawer.kt:25)
    at org.jetbrains.skiko.Actuals_awtKt$makeDefaultRenderFactory$1.createRedrawer(Actuals.awt.kt:32)
    at org.jetbrains.skiko.SkiaLayer.findNextWorkingRenderApi(SkiaLayer.awt.kt:285)
    at org.jetbrains.skiko.SkiaLayer.init(SkiaLayer.awt.kt:305)
    at org.jetbrains.skiko.SkiaLayer.addNotify(SkiaLayer.awt.kt:130)
    at androidx.compose.ui.awt.ComposeLayer$ComponentImpl.addNotify(ComposeLayer.desktop.kt:215)
    at java.desktop/java.awt.Container.addNotify(Container.java:2801)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    at androidx.compose.ui.awt.ComposeWindowDelegate$_pane$1.addNotify(ComposeWindowDelegate.desktop.kt:80)
    at java.desktop/java.awt.Container.addNotify(Container.java:2801)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    at java.desktop/java.awt.Container.addNotify(Container.java:2801)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    at java.desktop/java.awt.Container.addNotify(Container.java:2801)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
    at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:729)
    at java.desktop/java.awt.Container.addNotify(Container.java:2801)
    at java.desktop/java.awt.Window.addNotify(Window.java:787)
    at java.desktop/java.awt.Frame.addNotify(Frame.java:493)
    at java.desktop/java.awt.Window.pack(Window.java:825)
    at androidx.compose.ui.util.Windows_desktopKt.makeDisplayable(Windows.desktop.kt:160)
    at androidx.compose.ui.window.Window_desktopKt$Window$11$1.invoke(Window.desktop.kt:392)
    at androidx.compose.ui.window.Window_desktopKt$Window$11$1.invoke(Window.desktop.kt:385)
    at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$3.invoke(AwtWindow.desktop.kt:83)
    at androidx.compose.ui.window.AwtWindow_desktopKt$AwtWindow$3.invoke(AwtWindow.desktop.kt:81)
    at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2$performUpdate$2.invoke(UpdateEffect.desktop.kt:58)
    at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2$performUpdate$2.invoke(UpdateEffect.desktop.kt:54)
    at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2117)
    at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:113)
    at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2.invoke$performUpdate(UpdateEffect.desktop.kt:54)
    at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2.invoke(UpdateEffect.desktop.kt:62)
    at androidx.compose.ui.util.UpdateEffect_desktopKt$UpdateEffect$2.invoke(UpdateEffect.desktop.kt:47)
    at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:81)
    at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1032)
    at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:793)
    at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:813)
    at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:827)
    at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:519)
    at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:219)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
eymar commented 1 year ago

Unfortunately, I didn't manage to reproduce the issue in SplitPane:demo - it works as expected. I tried both 1.2.0 and 1.2.1 versions:

implementation("org.jetbrains.compose.components:components-splitpane-desktop:1.2.0")
and
implementation("org.jetbrains.compose.components:components-splitpane-desktop:1.2.1")

Could you please share your project or a small sample to reproduce the issue?

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.