hello everyone, currently running into a weird iss...
# koin
w
hello everyone, currently running into a weird issue with Koin in a Compose multiplatform project. I have my DI set up with Koin using
KoinMultiplatformApplication
and have just set up deep linking. The initial prototype of the deep link is working fine on iOS but when testing on Android, an
java.lang.IllegalStateException: KoinApplication has not been started
error is thrown crashing the application. I’ve tried changing to using
KoinApplication
following https://carrion.dev/en/posts/koin-cmp/ as seen in the comments of https://github.com/InsertKoinIO/koin/issues/2157 to no change in the behavior, with the same illegal state exception. The tested Koin version is 4.1.1 The Compose version is 1.9.0 The full stack trace in 🧵 Thanks in advance!
Copy code
FATAL EXCEPTION: main
Process: com.envent.app, PID: 16201
java.lang.IllegalStateException: KoinApplication has not been started
at org.koin.core.context.GlobalContext.get(GlobalContext.kt:36)
at org.koin.mp.KoinPlatform.getKoin(KoinPlatform.kt:54)
at org.koin.compose.KoinApplicationKt.getDefaultRootScope(KoinApplication.kt:56)
at org.koin.compose.KoinApplicationKt.KoinApplication$lambda$9$lambda$8(KoinApplication.kt:113)
at org.koin.compose.KoinApplicationKt.$r8$lambda$7HAQgOZsVqryU55T-hsubOW52qA(Unknown Source:0)
at org.koin.compose.KoinApplicationKt$$ExternalSyntheticLambda8.invoke(D8$$SyntheticClass:0)
at org.koin.compose.ComposeContextWrapper.resetValue(ComposeContextWrapper.kt:15)
at org.koin.compose.KoinApplicationKt.currentKoinScope(KoinApplication.kt:88)
at com.envent.app.ComposableSingletons$AppKt.lambda_579414744$lambda$0(App.kt:323)
at com.envent.app.ComposableSingletons$AppKt.$r8$lambda$_YqcmK1KTCrx5UkcKkce8OzLPNk(Unknown Source:0)
at com.envent.app.ComposableSingletons$AppKt$$ExternalSyntheticLambda9.invoke(D8$$SyntheticClass:0)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.kt:121)
at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$1.invoke(ComposableLambda.kt:122)
at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$1.invoke(ComposableLambda.kt:122)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:196)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2895)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:3231)
at androidx.compose.runtime.ComposerImpl.doCompose-aFTiNEg(Composer.kt:3855)
at androidx.compose.runtime.ComposerImpl.recompose-aFTiNEg$runtime(Composer.kt:3779)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:1075)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1364)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:156)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2.invokeSuspend$lambda$22(Recomposer.kt:627)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2.$r8$lambda$OqADLCDYmRw1RgNUvn1CR0kX32M(Unknown Source:0)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$$ExternalSyntheticLambda0.invoke(D8$$SyntheticClass:0)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:39)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:108)
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:1568)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1579)
at android.view.Choreographer.doCallbacks(Choreographer.java:1179)
at android.view.Choreographer.doFrame(Choreographer.java:1104)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1553)
at android.os.Handler.handleCallback(Handler.java:995)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loopOnce(Looper.java:248)
at android.os.Looper.loop(Looper.java:338)
at android.app.ActivityThread.main(ActivityThread.java:9067)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:932)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@14aab41, androidx.compose.ui.platform.MotionDurationScaleImpl@23ee8e6, StandaloneCoroutine{Cancelling}@7a36e27, AndroidUiDispatcher@54ff8d4]