-
Notifications
You must be signed in to change notification settings - Fork 174
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 freezing when using iOS #442
Comments
Also just to add this other error on xcode Thread 1: signal SIGABRT |
Having similar error when trying to start similar (Thread 1: EXC_BAD_ACCESS (code=1, address=0x18) Stacktrace excerpt
|
Hi, Actually I do use Kodein inside a Compose Multiplatform project, with Android and iOS. Do you have a simple reproducer project ? |
@schmidt9 @alfietapping Here is my (non) reproducer: |
@romainbsl your reproducer works, so problem seems to be in other dependency (Voyager), trying to figure out with a separate reproducer
|
I also usse voyager with Kodein on a CMP project. |
Well I seem to find the cause (not obvious for me) - declaration order
|
Well... This looks normal to me. if you do something like val di = DI { import(myModule) }
val myModule = DI.Module("whatever") { ... } Using This is like doing a function: fun do() {
val a = b + 1 // b is unknown
val b = 2
} However, with Kodein you can still declare (2) before (1) by using a lazy property, like: // 2
val di by DI.lazy {
importAll(homeScreenModule)
}
// 1
val homeScreenModule = DI.Module(name = "homeScreen") {
bindProvider {
HomeScreenModel()
}
} There is no compiler issue, as the DI lambda could be lazy, but the compiler knows nothing about this. |
I closed the issue, but do not hesitate to reopen if needed. |
thanks a lot for quick help, actually I'm not sure that @alfietapping has the same issue... but mine is solved |
dependency - org.kodein.di:kodein-di-framework-compose:7:20:1
Im injecting a ScreenModel from the Voyager library and all is working well when i run the app on Android, but if i try to run it on iOS i get a vague error from xcode which i suspect is around memory management and the app freezes
Heres my screen model
Im then using realm
Providing deps
Then eventually in my App composable
The text was updated successfully, but these errors were encountered: