Koin v3

Setup Koin for your project

Current Version

Here are the current versions of Koin:

// Current version
koin_version= "3.1.2"
info

Due to Jcenter shutdown, the koin project's maven group id was previously org.koin and is now io.insert-koin. Please check your configuration with modules below.

You can find all Koin packages on maven central.

Gradle dependencies

Add the following Gradle dependencies to add Koin to your project:

// Add Maven Central to your repositories if needed
repositories {
mavenCentral()
}

Kotlin

// Koin core features
implementation "io.insert-koin:koin-core:$koin_version"
// Koin test features
testImplementation "io.insert-koin:koin-test:$koin_version"

JUnit

// Koin for JUnit 4
testImplementation "io.insert-koin:koin-test-junit4:$koin_version"
// Koin for JUnit 5
testImplementation "io.insert-koin:koin-test-junit5:$koin_version"

Android

// Koin main features for Android (Scope,ViewModel ...)
implementation "io.insert-koin:koin-android:$koin_version"
// Koin Java Compatibility
implementation "io.insert-koin:koin-android-compat:$koin_version"
// Koin for Jetpack WorkManager
implementation "io.insert-koin:koin-androidx-workmanager:$koin_version"
// Koin for Jetpack Compose
implementation "io.insert-koin:koin-androidx-compose:$koin_version"

Ktor

// Koin for Ktor
implementation "io.insert-koin:koin-ktor:$koin_version"
// SLF4J Logger
implementation "io.insert-koin:koin-logger-slf4j:$koin_version"