0PricingLogin
Kotlin Multiplatform Academy · Lesson

Start Koin on Android & iOS

Initialize the graph from each platform's entry point.

A Module Needs Starting

Declaring modules is only half the job. Each platform must start Koin at launch so the container is ready before anything asks for a dependency.

A Shared Init Helper

Put the common startup in shared code with a small initKoin function. Both platforms call it, so the wiring never drifts apart.

fun initKoin() = startKoin {
    modules(appModule())
}

All lessons in this course

  1. Declare a Shared Koin Module
  2. single vs factory Scopes
  3. Start Koin on Android & iOS
  4. Inject into ViewModels & Repos
← Back to Kotlin Multiplatform Academy