Hey all, I'm working on a PoC for a CMP app, and I...
# koin
r
Hey all, I'm working on a PoC for a CMP app, and I'm running into issues with Koin on iOS. The error I'm getting is that the KoinApplication has not been started. I'm using the out of the box setup for iOS with the embed framework configuration. Now where things may differ, is that I have two shared modules I'm compiling into iOS. One called shared, which is domain and data layer logic. Then another called sharedCompose which is pure UI. sharedCompose depends on shared in my gradle config. I haven't had issues starting the iOS app as long as I'm not doing anything with Koin immediately within my Compose code. Now that I am, it crashes because it doesn't have KoinApplication. Android runs just fine, no issues with Koin. Any ideas on what might be happening?
✅ 1
a
so that has to be the reason, application has not been started on ios. you need to start it as you probably already doing in android application onCreate or in the activity controller. the same should be done in ios either in application or the ui controller
r
I am calling a startKoin helper function inside of the init function for iOS app start
d
I have quite similar configuration as you described and it works fine on iOS. Most probably the reason in some details of your implementation. I would recommend to list the issue to koin with the minimized reproducer project.
r
Yeah for sure, thanks
I ended up solving this problem by checking on the module configuration. My issue was that I was creating and embedding two different xcframeworks into the iOS app instead of creating an umbrella framework. Once I combined my modules into one framework and exposed the umbrella framework to iOS, I was able to get Koin working again.
💡 1