# How to use Koin Compiler in a Multimodule Project?

DevFeed: [How to use Koin Compiler in a Multimodule Project?](<https://devfeed.tech/articles/how-to-use-koin-compiler-in-a-multimodule-project-22969.md>)

Original publisher: [Read original article](<https://blog.insert-koin.io/how-to-use-koin-compiler-in-a-multimodule-project-6bd8e57d5e4b?source=rss----925561f2ecdf---4>)

Author: Gabriel Bronzatti Moro

Published: 2026-06-11T08:47:55Z

Content type: tutorial

Language: en

Sources: [Koin developers - Medium](<https://devfeed.tech/sources/koin-developers-medium.md>)

Topics: [koin](<https://devfeed.tech/topics/koin.md>), [compose-multiplatform](<https://devfeed.tech/topics/compose-multiplatform.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-multiplatform](<https://devfeed.tech/tags/compose-multiplatform.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [koin](<https://devfeed.tech/tags/koin.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [migrate](<https://devfeed.tech/tags/migrate.md>), [multi-module-project](<https://devfeed.tech/tags/multi-module-project.md>), [plugin](<https://devfeed.tech/tags/plugin.md>)

## AI overview

A tutorial on migrating a Compose Multiplatform multi-module project to the Koin Compiler. It covers the required Kotlin and Koin versions, configuring the compiler dependency through Gradle, creating a convention plugin, applying it to modules, and updating module initialization. The article reports replacing an approximately 80-line custom Gradle plugin with a simpler approximately 30-line setup while retaining compile-time safety through the K2 compiler.

## Source excerpt

Hey everyone! Today we're diving into how to use the Koin Compiler in a Compose Multiplatform multi-module project. In the previous article, we explored how to migrate a multimodule setup to Koin Annotations, using a convention Gradle plugin to move forward in small, safe steps. We'll follow that same approach diving deep into a project called MovieDB-App👋 A sticky note attached to a wall with the words "how to" written on it - Unsplash by walls_ioFirst step: Update your project, if necessary 🚀 Your project is eligible to support the Koin Compiler if it meets at least the following requirements: ✅ Kotlin 2.3.x or higher (K2 is required) ✅ Koin 4.2.x or higher Our sample project is using the following stack overview: 🤖 AGP: 9.1.0 🧩 Kotlin: 2.3.20 💉 Koin: 4.2.1 🏷 Koin Annotations: 2.3.1 Second step: Configure Koin compiler dependency Let's add our Koin Compiler dependency into the libs.versions.toml : #gradle/libs.versions.toml [versions] koin-compiler-plugin = "1.0.0" ... [libraries] koin-compiler-plugin = { group = "io.insert-koin", name = "koin-compiler-gradle-plugin", version.ref = "koin-compiler-plugin" } Now, let's run Gradle Sync 🐘 Our mission is to create a conventional plugin in our build-logic so we can migrate the project module by module, taking small and safe steps along the way. To achieve that let's add the koin compiler dependency as a depency of our build-logic: // build-logic/build.gradle.kts ... dependencies { implementation(libs.koin.compiler.plugin) } After syncing Gradle, it's time to create our conventional plugin: // build-logic/src/main/kotlin/plugins/KoinCompilerSetupPlugin.kt package plugins import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.the import org.koin.compiler.plugin.KoinGradleExtension // Ref: https://github.com/InsertKoinIO/koin-compiler-plugin/blob/main/docs/CASE_S