Skip to content

Releases: InsertKoinIO/koin

Koin 4.2.1

10 Apr 14:24

Choose a tag to compare

Support for Compile Safety with Koin Compiler 1.0.0-RC1

Bug Fixes

  • Fix stacked-params lookup on linked scopes (#2387) — The 4.2.0 resolver rewrite (CoreResolverV2) walked linked scopes but dropped the per-parent stacked-parameters check that 4.1.x performed via recursion. This broke patterns where AndroidParametersHolder is stacked on the factory scope by KoinViewModelFactory and SavedStateHandle is then resolved from a child ViewModel scope. Linked-scope resolution now also checks stacked params on each parent scope.

  • Restore ABI compatibility for runOnKoinStarted (#2391) — The 4.2.0 release inadvertently broke binary compatibility for runOnKoinStarted on JVM. Fixed by restoring the original JVM class name via @JvmName/@JvmMultifileClass annotations.

  • Fix scope _closed concurrency issue (#2389) — The Scope._closed flag was not volatile, which could cause stale reads under concurrent access.

Improvements

  • Improved Scope resolution error messagesCoreResolverV2 now provides clearer error messages when scope resolution fails, making it easier to diagnose misconfigured scopes.

  • Added apiCheck to CI — Binary compatibility validation (kotlinx.binary-compatibility-validator) now runs on every PR to prevent future ABI breaks.

Documentation

  • parametersOf type-collision warning (#2328) — Added a caution note explaining that when a value passed via parametersOf has the same type as the requested definition, Koin returns the value directly and skips the factory block. Suggests using a wrapper type as a workaround.

Contributors

Thanks to the following contributors for this release:

Koin 4.2.1-RC1

03 Apr 17:13

Choose a tag to compare

Koin 4.2.1-RC1 Pre-release
Pre-release

Koin 4.2.1-RC1

Bug Fixes

  • Fix ABI break on runOnKoinStarted (#2391) — The 4.2.0 refactor to move waitAllStartJobs to common code changed the JVM symbol for runOnKoinStarted from KoinWaitExtKt to KoinWaitExt_jvmKt, causing NoSuchMethodError at runtime for libraries compiled against 4.1.x. Fixed by adding @file:JvmName("KoinWaitExtKt") and @file:JvmMultifileClass to restore the original symbol.

  • Improved scope resolution error messages (#2379) — NoDefinitionFoundException now displays the full scope chain that was searched and indicates which scope qualifier is missing a definition, making scope resolution issues much easier to diagnose.

CI / Tooling

  • Added apiCheck to CI — The binary-compatibility-validator plugin was already configured but not running on PRs. apiCheck is now part of the CI build workflow, preventing accidental ABI breaks in future releases.
  • Updated .api dump files for all modules to reflect the current public API surface.

Still in progress for 4.2.1 final

  • PR #2389@Volatile on Scope._closed for concurrency fix
  • PR #2358 — Fix ClassCastException reading environment properties (#2348)
  • Documentation updates: #2339, #2336, #2328, #2218

4.2.0

17 Mar 16:59

Choose a tag to compare

Kotlin 2.3.20

New Features

  • Ktor 3.4 DI Bridge — Full integration with Ktor's new DI system (ktor-server-di), bridging Ktor ↔ Koin dependency injection both ways
  • Dagger Bridge (koin-dagger-bridge) — New module to help inject Koin components from Dagger side
  • AndroidX Navigation 3 support — Entry point provider with metadata parameter passing (animations, etc.), generic EntryProvider, and navigation scopes
  • Navigation Scope for Compose Nav 2 — Added scoped navigation support for Compose Navigation 2
  • Lazy Modules — Parallel loading at startup for improved performance, with benchmarks
  • strictOverride option — New definition option to override explicitly
  • koinActivityInject — Helper to retrieve dependencies against Activity scope
  • Koin Compiler Stubs — Added stubs for KoinApplication.modules() functions
  • KoinApplication.withConfiguration() — New configuration support

Performance & Stability

  • Core Resolver V2 — Fixed parameter stack propagation, injected params handling, and child scope/ViewModel scope resolution
  • Scope Resolution & Thread Safety — Performance optimization with safer ScopeFactory protecting all operations from parallel calls
  • ThreadLocal loading optimization — Avoid cost per Scope (#2306)
  • getAll no longer sorted by default — Instances come as declared; sort on purpose if needed
  • Params stack access optimization

Bug Fixes

  • Fix sharedKoinViewModel with type-safe navigation routes (#2293)
  • Fix qualified name usage in WASM (#2312)
  • Fix premature release of scope & context in Compose — don't drop in onForgotten (#2274)
  • Fix crashing declarations for LocalKoinScope & LocalKoinApplication
  • Fix Compose Koin Context Loader and Entry Points (#2327)
  • Fix CoreResolution with Child Scopes / ViewModelScope (#2325)
  • Fix Scope Archetypes Qualifier in plugin support functions
  • Fix qualifier conversion

Breaking Changes

  • minSdk raised to 23 for Android
  • module renamed to lazyModule in some contexts
  • BeanDef constructor change (API signature update)

Dependencies ...

Read more

Koin 4.2.0-RC2

12 Mar 13:44
81c55e2

Choose a tag to compare

Second Release Candidate for Koin 4.2.0, upgrading to Kotlin 2.3.20-RC2 and updating dependencies.

What's Changed

Kotlin 2.3.20-RC2 Upgrade

Koin Compiler Plugin: New KoinApplication.modules() Stubs

  • Added compiler plugin stubs for KoinApplication.modules<T>() (reified single module) and KoinApplication.modules(vararg KClass<*>) (multiple modules) — enabling type-safe module loading via the
    Koin Annotations compiler plugin

Koin Compiler Plugin 0.4.0 Support

  • Added compiler plugin stubs for KoinApplication.modules<T>() (reified single module) and KoinApplication.modules(vararg KClass<*>) (multiple modules) — enabling type-safe module loading via the
    Koin Compiler Plugin

Dependency Updates

  • Kotlin: 2.3.20-Beta1 → 2.3.20-RC2
  • Compose Multiplatform: 1.10.0 → 1.10.2
  • AndroidX Activity: 1.12.2 → 1.12.4
  • AndroidX WorkManager: 2.11.0 → 2.11.1
  • AndroidX Navigation: 2.9.6 → 2.9.7
  • AndroidX Navigation3: 1.0.0 → 1.0.1
  • JetBrains Navigation: 2.9.1 → 2.9.2
  • Robolectric: 4.16 → 4.16.1
  • Benchmark: 0.4.15 → 0.4.16

Full Changelog

4.2.0-RC1...4.2.0-RC2

4.2.0-RC1

02 Feb 08:17

Choose a tag to compare

Koin 4.2.0-RC1

This Release Candidate consolidates all features, improvements, and bug fixes from the alpha and beta series. The focus has been on Compose integration stability, scope resolution improvements, Ktor 3.4 DI Bridge, and compiler plugin support.

Highlights

Ktor 3.4 DI Bridge Integration

Navigation 3 Support

  • New koin-compose-navigation3 module for AndroidX Navigation3 1.0.0 - #2302 by @arnaudgiuliani
  • EntryProvider API for scoped dependency injection in navigation destinations
  • Metadata parameter passing support (animations, etc.) - 7fbab5e by @arnaudgiuliani
  • Make nav3 EntryProvider generic - #2314 by @xephosbot

Compose Improvements

ViewModelScope Updates

  • ⚠️ Breaking ⚠️: ViewModel declarations requiring scope injection must now be inside view...
Read more

4.2.0-beta4

21 Jan 06:56

Choose a tag to compare

4.2.0-beta4 Pre-release
Pre-release

Koin 4.2.0-beta4

New Features

Ktor 3.4 DI Bridge Integration (#2294)

  • Added KoinDependencyMapExtension implementing Ktor 3.2+'s DependencyMapExtension interface (00496cc)
  • Bidirectional dependency resolution between Koin and Ktor DI:
    • Koin can resolve Ktor DI dependencies via KtorDIExtension
    • Ktor DI can resolve Koin dependencies via KoinDependencyMap
  • New KoinKtorApplication DSL for explicit bridging configuration options (53cfc64)
  • SPI registration for automatic extension discovery
  • New sample application demonstrating Koin + Ktor DI usage

Koin Plugin Support Improvements

  • Adjusted KoinApplication.withConfiguration() API support (c4a5dcb)
  • Enhanced ApplicationDSLExt with additional plugin/module DSL extensions
  • Added Koin instance extension methods for better integration support

Bug Fixes

  • Module flatten order error (#1999, #1998) - Fixed incorrect module flattening order that could cause dependency resolution issues
  • Fixed Qualifier conversion in Ktor DI bridge (90edf60)

Dependencies

  • Updated to Ktor 3.4.0-eap-1520 (75d4306)

Note: This release requires the Ktor EAP repository. Add the following to your settings.gradle.kts:
maven("https://maven.pkg.jetbrains.space/public/p/ktor/eap")

Full Changelog: 4.2.0-beta3...4.2.0-beta4

4.2.0-beta3

16 Jan 07:31

Choose a tag to compare

4.2.0-beta3 Pre-release
Pre-release

4.2.0-beta3

⚠️ ViewModelScope Declaration Requirement Updated

Experimental Feature: The automatic scope creation for ViewModel constructor injection now requires ViewModel declarations to be part of the viewModelScope section. If declared outside, injection will look in the root scope instead of the ViewModel scope, causing resolution failures.

  // Injection against root scope
  viewModel { MyViewModel(get()) }

  // Injection against viewModel scope
  viewModelScope {
      viewModel { MyViewModel(get()) }
  }

Koin Compiler Plugin Support API

New Plugin Support API for Koin Annotations compiler plugin integration:

  • ModuleExt - Module extensions for plugin-generated code
  • CreateDSL - DSL for plugin code generation
  • BaseDSLExt - Base DSL extensions
  • ApplicationDSLExt - Application-level DSL extensions
  • ViewModelDSLExt / ViewModelModuleExt - ViewModel support for plugin
  • WorkerDSLExt / WorkerModuleExt - Android Worker support for plugin

Bug Fixes

Features & Improvements

Libraries & Dependencies

  • Kotlin 2.3.20-Beta1
  • Coroutines 1.10.2
  • Compose Multiplatform 1.10.0
  • AndroidX Lifecycle 2.10.0 / JetBrains Lifecycle 2.9.6
  • AndroidX Navigation 2.9.6 / JetBrains Navigation 2.9.1
  • AndroidX Navigation3 1.0.0
  • Ktor 3.3.3

Other

New Contributors

Full Changelog: 4.2.0-beta2...4.2.0-beta3

4.2.0-beta2

09 Dec 13:04

Choose a tag to compare

4.2.0-beta2 Pre-release
Pre-release

What's Changed

Full Changelog: 4.2.0-alpha3...4.2.0-beta2

4.2.0-alpha3

26 Nov 10:03

Choose a tag to compare

4.2.0-alpha3 Pre-release
Pre-release

What's Changed

Full Changelog: 4.2.0-alpha2...4.2.0-alpha3

4.2.0-alpha2

10 Nov 17:59

Choose a tag to compare

4.2.0-alpha2 Pre-release
Pre-release

What's Changed

Full Changelog: 4.2.0-alpha1...4.2.0-alpha2