Hi everyone! does anyone have experience using koi...
# multiplatform
m
Hi everyone! does anyone have experience using koin + multimodules architecture? I have “:shared” module that inclues a “:networking” module. In the networking module I have module {singleton { A() }}. Everything works in the android app, but in the ios app runtime I get an error:
Copy code
Koin Context configured. Please use startKoin or koinApplication DSL.
m
You need do run startKoin for koin Ti resolve the dependency graph. Expose this method to your ios app and call it in AppDelegate. Or do you do it already?
m
Of course I run startKoin (like in PeopleInSpace App). I also add, that if I move the module definition to shared, everything works
m
Then more code would be helpful. Anyway, this is a long shot, but if you're using the reflection api in koin (the one where you don't provide dependencies with get() but instead just provide the type), I think it might not be available in kotlin native
m
Maybe this line helps:
Copy code
(/Users/a.giuliani/workspace/koin_3.0.0/koin-projects/koin-core/src/commonMain/kotlin/org/koin/core/context/KoinContextHandler.kt:38:35)
m
@Mariusz Tański You can check my project, you have the example there between
client
and
common
and the platform structures are like this
Copy code
android---\
web---------client-----\
ios-------/             ----- common
          backend------/
https://github.com/CurrencyConverterCalculator/CCC
m
Thx. I will check
👌 1