Multiplatform dependency injection libraries equivalent to Dagger/Anvil

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

Our great sponsors
  • Scout APM - Truly a developer’s best friend
  • Zigi - Workflow assistant built for devs & their teams
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • SonarLint - Clean code begins in your IDE with SonarLint
  • 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:

  • 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:

  • Scout APM

    Truly a developer’s best friend. Scout APM is great for developers who want to find and fix performance issues in their applications. With Scout, we'll take care of the bugs so you can focus on building great things 🚀.

  • koin

    Koin - a pragmatic lightweight dependency injection framework for Kotlin

    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).

  • 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.

  • 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.

  • Zigi

    Workflow assistant built for devs & their teams. Automate the mundane part of your day, with live actionable messages for your GitHub & Jira tasks.

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