koin
koin copied to clipboard
App Crashing in Ios screen Rotation
org.koin.core.error.KoinAppAlreadyStartedException: Trying to run new Koin Application whereas Koin is already started. Use 'KoinContext()' instead of check for any 'startKoin' usage.
In ios whenever i rotate screen app is crashing and getting error but in android app is not crashing on rotate of screen,
Version - koin = "3.5.6" - koin-compose = "1.1.5"
Sample Code
In CommonMain
@Composable fun App(context: Context) {
KoinApplication(application = {
modules(getSharedModules(context))
}) {
AppTheme {
var showContent by remember { mutableStateOf(false) }
Column(
Modifier
.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally
) {
Navigator(SplashScreen)
}
}
}
}
In SharedModule.kt file
fun getSharedModules(context: Context) = listOf(authModule(),homeModule(), datastoreModule(context), networkModule())