Multiplatform dependency injection libraries equivalent to Dagger/Anvil

This page summarizes the projects mentioned and recommended in the original post on /r/Kotlin

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. anvil

    A Kotlin compiler plugin to make dependency injection with Dagger 2 easier. (by square)

    I'm currently using Dagger and Anvil for my DI needs. It's been working really well, especially around what Anvil permits in terms of multibindings defined on the type declaration rather than in a module. For example:

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. Dagger2

    A fast dependency injector for Android and Java.

    I'm currently using Dagger and Anvil for my DI needs. It's been working really well, especially around what Anvil permits in terms of multibindings defined on the type declaration rather than in a module. For example:

  4. koin

    Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform

    I started looking into using Kotlin/JS, and hopefully reusing a bit of code that I have, which is using Dagger and Anvil - which of course are JVM only. So I've been looking for other solutions, namely Koin and Kodein. Koin's multibinding support is... not really amazing (e.g. here, and while Kodein does support multibinding, it doesn't seem to support things like that at the declaration site - everything needs to be specified in a "DI container" (module).

  5. dikt

    Simple and powerful DI for kotlin multiplatform

    You might want to check this out https://github.com/sergeshustoff/dikt. The repo also lists other alternatives that you can look into.

  6. kotlin-inject

    Dependency injection lib for kotlin

    I would suggest looking at Kotlin-Inject, it's a compile-time DI like Dagger and it's really pleasant to use.

  7. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Refactoring our Dependency Injection using Anvil

    2 projects | /r/RedditEng | 6 Feb 2023
  • Seven Legacy Technologies in Android Development and Their Modern Counterparts

    1 project | dev.to | 27 Jan 2025
  • Modern Dependency Injection with Koin: The Smart DI Choice for 2025

    1 project | dev.to | 2 Nov 2024
  • When developing a Compose application......

    1 project | dev.to | 29 Oct 2024
  • Koin is now updated to support the latest Kotlin version

    1 project | dev.to | 24 Oct 2024

Did you know that Kotlin is
the 17th most popular programming language
based on number of references?