razaghimahdi / Shopping-By-KMP

This is a cross-platform application that is built using Jetpack Compose Multiplatform, a declarative framework for sharing UIs across multiple platforms with Kotlin.
https://github.com/razaghimahdi/Shopping-By-KMP
MIT License
156 stars 25 forks source link

Configuration changes ignore? #5

Open hulkdx opened 4 days ago

hulkdx commented 4 days ago

https://github.com/razaghimahdi/Shopping-By-KMP/blob/62b3e26495bac0019ec5162141261b30543028cd/androidApp/src/androidMain/AndroidManifest.xml#L22

Why this is added? If you remove this and try to rotate the device koin will cause a crash:

Caused by: 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.

I don't think so ignoring configuration changes is a good idea.

razaghimahdi commented 3 days ago

Hi there, thank u for letting me know. I'll fix it ASAP, then I'll give u updates

razaghimahdi commented 3 days ago

Actually, I didn't notice any crash while rotating. would u please give me more info? where this happens ?

hulkdx commented 1 day ago

Actually, I didn't notice any crash while rotating. would u please give me more info? where this happens ?

I mean if you remove this line, the app would crash on rotation

razaghimahdi commented 1 day ago

Do not remove whole line, just remove orientation|

hulkdx commented 9 hours ago

Actually your koin version is old so if you update your koin-compose you notice the crash with removing this line, its possibly due to the koin itself, probably using KoinApplication can cause it.

https://github.com/InsertKoinIO/koin/issues/1884

Removing KoinApplicaion in compose and replacing it with startKoin on androidapplication would fix it though