Open AlexanderEggers opened 4 months ago
I am having the same issue after upgrading to 3.6.0-Beta4. When looking at the stacktrace, the error comes from Voyager in my case.
Update the code you took from voyager to the following:
public inline fun <reified T : ScreenModel> Screen.koinScreenModel(
qualifier: Qualifier? = null,
scope: Scope = currentKoinScope(),
noinline parameters: ParametersDefinition? = null
): T {
val st = parameters?.let { rememberUpdatedState(parameters) }
val tag = remember(qualifier, scope) { qualifier?.value }
return rememberScreenModel(tag = tag) {
scope.get(qualifier, st?.value)
}
}
@Composable
public inline fun <reified T : ScreenModel> Navigator.koinNavigatorScreenModel(
qualifier: Qualifier? = null,
scope: Scope = currentKoinScope(),
noinline parameters: ParametersDefinition? = null
): T {
val st = parameters?.let { rememberUpdatedState(parameters) }
val tag = remember(qualifier, scope) { qualifier?.value }
return rememberNavigatorScreenModel(tag = tag) {
scope.get(qualifier, st?.value)
}
}
Look at 4.0-RC1
I tested the latest Voyager with the Koin 4.0 RC1 and the crash still happens. It happens only when running my app on iOS (Android works fine)
Desktop app doesn't work as well with the same error
koin = "4.0.0-RC1"
voyager = "1.1.0-beta02"
I guess the problem is inside the Voyager. It uses
koin = "3.5.3"
koin-compose = "1.1.2"
cc @DevSrSouza
let me know 👍
Describe the bug When running my app (CMP v1.6.10 + Kotlin v2 + Voyager 1.1.0-beta01) after updating to 3.6.0-Beta4, I get the following exception on Android:
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.koin.compose.stable.StableHoldersKt"
Downgrading to the latest stable 3.5.x resolves the issue for me.
To Reproduce Unclear about the project structure which is needed to reproduce this issue. In my case it is sufficient to just update to the latest 3.6.0 beta version to reproduce this crash.
Expected behavior No crash.
Koin module and version: 3.6.0-Beta4
Snippet or Sample project to help reproduce