---
title: "Koin 4.0 Release: Powered by Kotlin 2.0"
description: Koin 4.0, powered by Kotlin 2.0.20, with major updates across Kotlin, Android, Compose, & Multiplatform APIs. Better dependency injection & performance.
image: https://blog.kotzilla.io/hubfs/Screenshot%202024-10-24%20at%2012.06.14.png
---

[Skip to content](https://blog.kotzilla.io/koin-4.0-powered-by-kotlin-2.0#main-content)

[![kotzilla (3)](https://blog.kotzilla.io/hubfs/kotzilla%20(3).svg)](https://kotzilla.io/)

- [Koin](https://insert-koin.io/)
- [Koin IDE Plugin](https://plugins.jetbrains.com/plugin/26131-koin-dependency-injection-official-)
- [Koin LTS](https://kotzilla.io/koin-lts)
- [Developer Hub](https://doc.kotzilla.io/)

Open main navigation

Close main navigation

- [Koin](https://insert-koin.io/)
- [Koin IDE Plugin](https://plugins.jetbrains.com/plugin/26131-koin-dependency-injection-official-)
- [Koin LTS](https://kotzilla.io/koin-lts)
- [Developer Hub](https://doc.kotzilla.io/)
- [Contact us](https://blog.kotzilla.io/koin-4.0-powered-by-kotlin-2.0#contact)

[Contact us](https://blog.kotzilla.io/koin-4.0-powered-by-kotlin-2.0#contact)

 Oct 15, 2024, 10:32:18 AM

# Koin 4.0 Release: Powered by Kotlin 2.0

[The Kotzilla Team](https://blog.kotzilla.io/author/the-kotzilla-team)

Share: [facebook-f icon](http://www.facebook.com/share.php?u=https://blog.kotzilla.io/koin-4.0-powered-by-kotlin-2.0) [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://blog.kotzilla.io/koin-4.0-powered-by-kotlin-2.0) [Twitter icon](https://twitter.com/intent/tweet?url=https://blog.kotzilla.io/koin-4.0-powered-by-kotlin-2.0) [pinterest-p icon](http://pinterest.com/pin/create/link/?url=https://blog.kotzilla.io/koin-4.0-powered-by-kotlin-2.0) [envelope icon](mailto:?body=https://blog.kotzilla.io/koin-4.0-powered-by-kotlin-2.0)

Koin 4.0 Release: Powered by Kotlin 2.0

4:11

![Koin 4.0 Powered by Kotlin 2.0](https://139572340.fs1.hubspotusercontent-eu1.net/hub/139572340/hubfs/Screenshot%202024-10-15%20at%2011.22.20.png?width=1200&length=1200&name=Screenshot%202024-10-15%20at%2011.22.20.png)

 

[Koin 4.0 is a major release](https://github.com/InsertKoinIO/koin/releases), now based on Kotlin 2.0.20.

It brings significant improvements across Kotlin, Android, Compose, and Multiplatform APIs. This version also includes important deprecations and API clean-ups, all aimed at streamlining the framework and improving performance.

*Here’s a detailed breakdown of what’s new and what you need to know:*

## **Kotlin 2.0.20: A New Baseline**

Ensure your project is using at least **Kotlin 2.0.20**. Older versions may lead to crashes due to changes in the Kotlin Multiplatform (KMP) API.

## **Core & Kotlin Multiplatform API Enhancements**

### **Internal Optimizations**:

- **Context Passing**: More dynamic handling of injected parameters, improving the resolution order based on definitions, parameters, and scope.
- **Thread-Safe Collections**: Improved internal collections for better stability in concurrent environments.
- **Kotlin Time API**:  Use the Kotlin standard Time API instead of old internals, simplifying internal architecture.

 

### **Koin-Fu Project (Experimental)**

The **Koin-Fu Project** is an experimental DSL project aimed at unifying the API and improving the user experience for better data handling and comprehension. The long-term goal is to support Koin-Fu through a Kotlin compiler plugin, moving away from the current reflection-based API. The project aims to refine the **lambda** and **singleOf** APIs and improve internal data for better configuration checks.

## **Android API Updates**

### **ViewModel API: Now Multiplatform**

The ViewModel API has been centralized in the koin-core-viewmodel package, making it fully multiplatform. Deprecated methods in the old ViewModel DSL are being phased out.

You can update your imports to `org.koin.core.module.dsl.*` to avoid warnings.

![Screenshot 2024-10-15 at 10.41.12](https://blog.kotzilla.io/hs-fs/hubfs/Screenshot%202024-10-15%20at%2010.41.12.png?width=600&height=401&name=Screenshot%202024-10-15%20at%2010.41.12.png)*koinViewModel with a Compose Multiplatform app*

### **AndroidX Startup: Optimized Loading**

The new koin-androidx-startup package optimizes the startup process, reducing load times by up to 40%. The onKoinStartup delegate simplifies configuration in the Application’s initialization.

### **Activity & Fragment Scope Fixes**

We've addressed scope propagation issues in Android Activity and Fragment lifecycle management.

## **Compose API Improvements**

We've updated Koin’s **Compose API** for better Multiplatform support.

The koin-androidx-compose and koin-compose-viewmodel APIs now share a unified codebase, improving integration across platforms.

We've also added full lifecycle handling and stable **WebAssembly (Wasm)** integration.

### **Testing API Enhancements**

### **Parameter Injection**

We've added support for injected parameters in the Verify() API, making it easier to test dynamic behavior. We've also improved parameter injection to better handle missing or incorrect definitions.

![Screenshot 2024-10-15 at 10.51.23](https://blog.kotzilla.io/hs-fs/hubfs/Screenshot%202024-10-15%20at%2010.51.23.png?width=600&height=176&name=Screenshot%202024-10-15%20at%2010.51.23.png)

### **Missing Definition or Parameter Generation**

We've enabled the Verify() API to automatically generate fixes for missing definitions, streamlining the testing process.

![Screenshot 2024-10-15 at 10.53.03](https://blog.kotzilla.io/hs-fs/hubfs/Screenshot%202024-10-15%20at%2010.53.03.png?width=600&height=157&name=Screenshot%202024-10-15%20at%2010.53.03.png)

*Code suggestion to resolve missing definitions or parameter injection issues.*

## Ktor API Updates

We've updated Koin’s integration with **Ktor 2.x**, improving scope management and implementing UUID-based scope instance identification. We are also planning future integrations for **Ktor 3**. Watch this space 

## **Breaking Changes**

Several deprecated APIs have been removed:

- - CheckModules: Replaced by the **Verify()** API.
    - **ViewModel DSL**: Now centralized in **koin-core-viewmodel** which is based on the new Multiplatform API.
    - **Reflection-based APIs**: The KoinReflect API and related annotations have been removed.
    - **Android ViewModel API**: Deprecated methods such as stateViewModel and sharedStateViewModel have been removed.
    - **Compose API**: Old methods like get, inject, and stateViewModel have been deprecated in favor of newer integrations.

### **Renamings**:

We've renamedApplicationAlreadyStartedException  to KoinApplicationAlreadyStartedException for improved clarity.

 

### **Documentation and Resources**

We've moved package information to the [Koin website](https://insert-koin.io/docs/setup/koin/), to reduce clutter in project README files.

Updated guides cover Compose integration, isolated contexts, and advanced use cases. You can find more detailed documentation on the [updated Compose page ](https://insert-koin.io/docs/reference/koin-compose/compose/)

[Koin](https://blog.kotzilla.io/tag/koin), [Android](https://blog.kotzilla.io/tag/android), [Kotlin](https://blog.kotzilla.io/tag/kotlin), [Dependency Injection](https://blog.kotzilla.io/tag/dependency-injection), [Kotlin Multiplatform](https://blog.kotzilla.io/tag/kotlin-multiplatform), [KMP](https://blog.kotzilla.io/tag/kmp), [Compose Multiplatform](https://blog.kotzilla.io/tag/compose-multiplatform)

## Related posts

[![](https://blog.kotzilla.io/hs-fs/hubfs/Screenshot%202024-02-05%20at%2016.40.56.png?height=200&name=Screenshot%202024-02-05%20at%2016.40.56.png)](https://blog.kotzilla.io/koin-3.6.0-wasm-alpha2)

[Koin](https://blog.kotzilla.io/tag/koin), [Android](https://blog.kotzilla.io/tag/android), [Kotlin Multiplatform](https://blog.kotzilla.io/tag/kotlin-multiplatform)

## [Introducing Koin 3.6.0-wasm-alpha2: Expanding Koin's Horizons to Kotlin/Wasm](https://blog.kotzilla.io/koin-3.6.0-wasm-alpha2)

[Arnaud Giuliani](https://blog.kotzilla.io/author/arnaud-giuliani) 

 Feb 5, 2024, 9:52:19 AM

The Kotlin ecosystem is undergoing rapid evolution, and with the recent elevation of Kotlin for...

[Read more](https://blog.kotzilla.io/koin-3.6.0-wasm-alpha2)

[![](https://blog.kotzilla.io/hs-fs/hubfs/Screenshot%202023-11-23%20at%2015.48.08.png?height=200&name=Screenshot%202023-11-23%20at%2015.48.08.png)](https://blog.kotzilla.io/koin-ready-for-kotlin-2.0)

[Koin](https://blog.kotzilla.io/tag/koin), [Kotlin](https://blog.kotzilla.io/tag/kotlin), [KMP](https://blog.kotzilla.io/tag/kmp)

## [Embracing the Future: Koin is Ready for Kotlin 2.0](https://blog.kotzilla.io/koin-ready-for-kotlin-2.0)

[The Koin crew](https://blog.kotzilla.io/author/the-koin-crew) 

 Nov 16, 2023, 5:05:14 PM

The Kotlin community is buzzing with the release of Kotlin 2.0.0-Beta 1. At the forefront of this...

[Read more](https://blog.kotzilla.io/koin-ready-for-kotlin-2.0)

[![](https://blog.kotzilla.io/hs-fs/hubfs/Screenshot%202023-10-24%20at%2011.17.33.png?height=200&name=Screenshot%202023-10-24%20at%2011.17.33.png)](https://blog.kotzilla.io/koin-for-kotlin-multiplatform)

[Koin](https://blog.kotzilla.io/tag/koin), [Android](https://blog.kotzilla.io/tag/android), [Kotlin](https://blog.kotzilla.io/tag/kotlin), [Dependency Injection](https://blog.kotzilla.io/tag/dependency-injection), [Kotlin Multiplatform](https://blog.kotzilla.io/tag/kotlin-multiplatform), [KMP](https://blog.kotzilla.io/tag/kmp)

## [Koin: The Kotlin Multiplatform (KMP) Dependency Injection Framework](https://blog.kotzilla.io/koin-for-kotlin-multiplatform)

[The Koin crew](https://blog.kotzilla.io/author/the-koin-crew) 

 Oct 24, 2023, 1:36:00 PM

Do you need to perform dependency injection while working with Kotlin Multiplatform (KMP)? As...

[Read more](https://blog.kotzilla.io/koin-for-kotlin-multiplatform)

facebook-f icon linkedin-in icon Twitter icon instagram icon

- Menu Item 1 
    - Sub-menu Item 1 
          - Another Item
    - Sub-menu Item 2
- Menu Item 2 
    - Yet Another Item
- Menu Item 3
- Menu Item 4

---

[![kotzilla-logo](https://blog.kotzilla.io/hubfs/kotzilla-logo.svg "kotzilla-logo")](http://www.kotzilla.io)

Copyright © 2025,

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "The Kotzilla Team",
    "url" : "https://blog.kotzilla.io/author/the-kotzilla-team"
  },
  "dateModified" : "2024-10-24T10:15:30.006Z",
  "datePublished" : "2024-10-15T08:32:18.000Z",
  "headline" : "Koin 4.0 Release: Powered by Kotlin 2.0",
  "image" : [ "https://blog.kotzilla.io/hubfs/Screenshot%202024-10-24%20at%2012.06.14.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.kotzilla.io/koin-4.0-powered-by-kotlin-2.0",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.kotzilla.io/hubfs/__Kotzilla_format-site-web-line%201.png"
    },
    "name" : "Kotzilla SAS"
  }
}
```