https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
m

Mariusz Tański

02/25/2021, 12:49 PM
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

Michal Klimczak

02/25/2021, 12:53 PM
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

Mariusz Tański

02/25/2021, 12:57 PM
Of course I run startKoin (like in PeopleInSpace App). I also add, that if I move the module definition to shared, everything works
m

Michal Klimczak

02/25/2021, 1:01 PM
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

Mariusz Tański

02/25/2021, 1:01 PM
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

Mustafa Ozhan

02/25/2021, 3:13 PM
@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

Mariusz Tański

02/25/2021, 3:14 PM
Thx. I will check
👌 1
2 Views