I'm running into a weird problem with a multiplatf...
# compose
s
I'm running into a weird problem with a multiplatform project. It runs fine on Android through IntelliJ, but crashes during a certain operation when run through Android Studio. Stacktrace in thread.
Copy code
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/event/KeyEvent;
                                                                                                    	at warlockfe.warlock3.compose.ui.settings.MacrosViewKt$MacrosView$1$2.invoke(MacrosView.kt:77)
                                                                                                    	at warlockfe.warlock3.compose.ui.settings.MacrosViewKt$MacrosView$1$2.invoke(MacrosView.kt:68)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:117)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$1.invoke(ComposableLambda.jvm.kt:129)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$1.invoke(ComposableLambda.jvm.kt:128)
                                                                                                    	at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:169)
                                                                                                    	at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2468)
                                                                                                    	at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2760)
                                                                                                    	at warlockfe.warlock3.compose.components.ScrollableColumnKt.ScrollableColumn(ScrollableColumn.kt:20)
                                                                                                    	at warlockfe.warlock3.compose.ui.settings.MacrosViewKt.MacrosView(MacrosView.kt:65)
                                                                                                    	at warlockfe.warlock3.compose.ui.settings.SettingsContentKt.SettingsContent(SettingsContent.kt:51)
                                                                                                    	at warlockfe.warlock3.compose.ui.settings.SettingsContentKt$SettingsContent$1.invoke(Unknown Source:39)
                                                                                                    	at warlockfe.warlock3.compose.ui.settings.SettingsContentKt$SettingsContent$1.invoke(Unknown Source:10)
                                                                                                    	at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:169)
                                                                                                    	at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2468)
                                                                                                    	at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2737)
                                                                                                    	at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3352)
                                                                                                    	at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3303)
                                                                                                    	at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:781)
                                                                                                    	at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1097)
                                                                                                    	at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:124)
                                                                                                    	at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:569)
                                                                                                    	at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:537)
                                                                                                    	at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41)
                                                                                                    	at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
                                                                                                    	at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
                                                                                                    	at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
                                                                                                    	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1337)
                                                                                                    	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1348)
                                                                                                    	at android.view.Choreographer.doCallbacks(Choreographer.java:952)
                                                                                                    	at android.view.Choreographer.doFrame(Choreographer.java:878)
                                                                                                    	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1322)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                    	at android.os.Looper.loop(Looper.java:294)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8177)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
                                                                                                    	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@98fcd1, androidx.compose.ui.platform.MotionDurationScaleImpl@8d18336, StandaloneCoroutine{Cancelling}@8f38237, AndroidUiDispatcher@ee563a4]
It seems like it's building with the JVM compose library when run through AS. Since it doesn't crash doing the exact same operation when run through IntelliJ, I assume it's building correctly on IntelliJ.
Source can be found at https://github.com/sproctor/warlock3 It crashes when viewing the macro settings, but otherwise works fine.