Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Crashing in Ios screen Rotation #1884

Open
pankaj1920 opened this issue May 25, 2024 · 1 comment
Open

App Crashing in Ios screen Rotation #1884

pankaj1920 opened this issue May 25, 2024 · 1 comment

Comments

@pankaj1920
Copy link

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())

@hulkdx
Copy link

hulkdx commented Jul 1, 2024

I get the same crash with above versions or these versions:
koin = "3.6.0-Beta4"
koin-compose = "1.2.0-Beta4"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants