NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Maven Central, #668 by repository stars
A fast dependency injector for Android and Java.
Latest stable
2.60.1
Last release 4 months ago
06 Jul 2026
Release timing varies
gaps range from 1 weeks to 4 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
108 releases · first in 2015
Drag across the ruler to compare, or tap a release to open it.
Fix #1987: Fixes a bug in version 2.28.2 that occurs when a transitive dependency installs something into ApplicationComponent and depends on a versio
ApplicationComponent and depends on a version of Hilt less than 2.28.2. (667a8e25)The Hilt class `dagger.hilt.android.components.ApplicationComponent` is being renamed to `dagger.hilt.components.SingletonComponent`. This release add
The Hilt class dagger.hilt.android.components.ApplicationComponent is being renamed to dagger.hilt.components.SingletonComponent. This release adds the new SingletonComponent class in preparation for this change without removing the existing ApplicationComponent. This rename is part of a plan to address https://github.com/google/dagger/issues/1908 to allow usage of Hilt in non-Android Gradle modules when installing into the SingletonComponent. Current users can begin switching to the new SingletonComponent name as of this release. A future release will remove ApplicationComponent.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
New Bazel helper macros for using Dagger. See the updated README for instructions. There are also examples using these macros for Dagger and Hilt (949
New Bazel helper macros for using Dagger. See the updated README for instructions. There are also examples using these macros for Dagger and Hilt (9494f40f).
Hilt is a new library that layers on top of Dagger and provides a standard way to incorporate Dagger into an Android application. For more information
Hilt is a new library that layers on top of Dagger and provides a standard way to incorporate Dagger into an Android application. For more information, see https://dagger.dev/hilt.
Dagger now includes Lint checks for Kotlin users. The checks cover the following cases:
field: site target in injected properties@JvmStatic in object modules.@Module (@Module should just be on the enclosing class)These checks are included by default for users of dagger-android and hilt-android. For Kotlin only projects the checks are available in a new artifact, com.google.dagger:dagger-lint:<version> and can be applied via the lintChecks configuration in Gradle:
apply plugin: "com.android.lint"
dependencies {
lintChecks "com.google.dagger:dagger-lint:<version>"
}
@kotlin.Metadata produced by Kotlin compiler versions earlier than 1.3. (477d052c)Fix #955: No longer generate MembersInjectors for types without local injection sites.
This release includes a flag for using the new experimental error message format. The format and some content of error messages will be changed with this flag in order to improve readability. Please leave feedback on issue #1769. Pending feedback, this format will eventually become the default and replace current error messages.
To opt-in to the new format use -Adagger.experimentalDaggerErrorMessages=enabled.
Currently, this flag:
Fix #1700: Remove usages of non-Android Guava APIs.
@Module annotated classes. (8190c7c1)Companion object modules are no longer allowed on Component#modules list (8190c7c1)
It is now an error to add an @Module annotated companion object class to Component#modules (or Subcomponent#modules) list. Instead, only the outer class should be added to the module list.
// Only add this class to the Component#modules list.
@Module
abstract class FooModule {
@Binds abstract fun bindFoo(impl: FooImpl): Foo
// @Module is no longer needed here!
companion object {
// @JvmStatic is no longer needed here!
@Provides fun provideBar(): Bar = Bar()
}
}
Note: For backwards compatibility, we still allow @Module on the companion object and @JvmStatic on the provides methods. However, @Module on the companion object is now a no-op and all of its attributes (e.g. "includes") will be ignored. In future releases, we will make it an error to use @Module on a companion object.
Dagger Android artifacts now use Androidx (f45213ea)
The following artifacts have been migrated from the support library to AndroidX:
com.google.dagger:dagger-android:2.26com.google.dagger:dagger-android-support:2.26This change may break users who have not already migrated to AndroidX. The fix is to either migrate your app to AndroidX, or switch back to the support library artifacts which are now available at:
com.google.dagger:dagger-android-legacy:2.26com.google.dagger:dagger-android-support-legacy:2.26# What's new Bug fixes - #1645: Fix memory leak in RequestKinds cache.
Bug fixes
Fix #1659: Add workaround for missing Kotlin qualifiers annotations across compilation units.
Bug fixes
Maintenance
The Kotlin change in 2.ii (below) will break users who were passing in object module instances into a Component builder method rather than using @JvmS
2.ii (below) will break users who were passing in object module
instances into a Component builder method rather than using @JvmStatic.
To fix this issue, remove the call to the builder method -- the module instance is
no longer needed and the Component builder method will no longer be generated.Bug fixes
Kotlin support
@field:MyQualifier (646e0336)@Module object classes no longer need @JvmStatic on the
provides methods. (0da21807)Performance Improvements
BindingGraph creation (5c34d6d7, e92edf6b, a8a00fa9, 86eb76ff)BindingGraph validation (48db4f12)_Factory proxy methods can now be accessed without
class loading the factory (a258d371).Depend on release 2.25.2 instead, which fixes issue #1639.
Do not depend on this release.
Depend on release 2.25.2 instead, which fixes issue #1639.
dagger.android's Has{Activity,Fragment,Service,ContentProvider,BroadcastReceiver} interfaces are now removed in favor of HasAndroidInjector (which can
dagger.android's Has{Activity,Fragment,Service,ContentProvider,BroadcastReceiver} interfaces are now removed in favor of HasAndroidInjector (which can handle any type). HasAndroidInjector was added in 2.23, and is supported together with the old types in that version. (3bd8f707)In addition to the 2.23.1 release notes, this release:
In addition to the 2.23.1 release notes, this release:
@Inject method has a parameter name that is valid on the JVM but invalid for the Java language (and can come up in some cases in Kotlin: a11605cfa56ad944892ef34fc19ac8dd64a9e89e)In addition to the 2.23 release notes, this release fixes support for gradle incremental annotation processing
In addition to the 2.23 release notes, this release fixes support for gradle incremental annotation processing (a91d9624)
Generated components are no longer public unless the component type is public
@BindsInstance annotations are now more strictly validated (d3ed46dd)-Adagger.formatGeneratedSource=enabled to turn it on. (fcd069cc)dagger.android.HasAndroidInjector, which will soon replace the Has*Injector interfaces. This one interfaces coalesces the others and should be functionally equivalent. (8f015262)-Adagger.moduleBindingValidation to -Adagger.fullBindingGraphValidation. The old name continues to work as an alias. (add5a744)@BindsInstance on a Builder setter method's parameter caused a failure in codegen if the parameter had a different name than the method itself (#1464). (8051d285)In addition to the 2.22 release notes, this release fixes an issue where @BindsInstance on a @Component.Builder setter method's parameter caused a fai
In addition to the 2.22 release notes, this release fixes an issue where @BindsInstance on a @Component.Builder setter method's parameter caused a failure in code generation if the parameter had a different name than the method itself (#1464). (8051d285)
_NOTE: A bug in the Dagger compiler was introduced in this release. A fix is available in 2.22.1_
NOTE: A bug in the Dagger compiler was introduced in this release. A fix is available in 2.22.1
@Component.Factory types for components instead of @Component.Builders. An @Component.Factory is stateless and has a single method, returning the creator type, that takes parameters for anything that a Builder could have setters for. (d3408866)@BindsInstance can now be applied to the parameter of a setter method on a builder rather than to the setter method itself, for consistency with factory methods. (60dc2a61)@BindsOptionalOf methods to require that they have a different name than any other binding method in the module; this was already true for all other types of binding methods (@Provides, @Binds etc.) but @BindsOptionalOf wasn't being included. (1ea36ecc)@Multibinds methods. This was never supported, but the scope was previously ignored. (9582bc37)BindingKind.SUBCOMPONENT_BUILDER to SUBCOMPONENT_CREATOR to reflect the fact that it can be a builder or a factory, and renamed the edge type to SubcomponentCreatorBindingEdge. (65e2209a)Deprecated dagger.producers.internal.Producers.immediateProducer() and dagger.producers.internal.Producers.immediateFailedProducer() in favor of newly…
@Inject binding in an ancestor component. This was never intended to be supported but never checked. Adds a flag to control whether that is a warning or an error. (7f5500fb)@ProducerModule in a @Subcomponent that is already installed in a parent (or earlier ancestor) component is now an error. It is also an error to repeat a @Module that has a binding in @ProductionScope. (68b21537)ComponentNode.isSubcomponent() (b6b9dcac)dagger.producers.internal.Producers.immediateProducer() and dagger.producers.internal.Producers.immediateFailedProducer() in favor of newly added methods with the same names in dagger.producers.Producers (a4914c61) (added in 50d7010f)Peformance improvements in annotation processing
@ProductionComponent have runtime retention so tools can interpret it like all of the other component annotations (fff65e3c)-Adagger.moduleBindingValidation=ERROR or =WARNING is set, then each module is processed as a kind of component (without generating any code) in order to validate the bindings installed by it and all included modules. Any binding graph errors, such as duplicate bindngs (but not including missing bindings), will be reported as errors or warnings depending on the option.Map<K, V>, Map<K, Provider<V>>, or Map<K, Producer<V>>. (350368e6)@ProductionScope bindings:
@ProductionScope bindings are installed in multiple components in the same component ancestry, the binding is now resolved only once and only in the rootmost component.@Inject bindings with @ProductionScope are referenced in a binding graph, the binding is now resolved in the rootmost @ProductionScope component.dagger.android code can no longer use the AndroidInjector.Factory<? extends Activity> format to bind injector factories. See https://google.github.io/dagger/android and the 2.19 release notes for information on how to migrate.AndroidSupportInjectionModule (which now is functionless) to AndroidInjectionModule. See these docs for how to apply the refactoring to your codebase if you're on dagger-compiler-2.20.dagger.releaseablereferences (a72c3428)-Adagger.floatingBindsMethods flag added in 2.17 (https://github.com/google/dagger/wiki/Dagger-2.17-@Binds-bugs) (bc8dd5bd)The dagger.android map keys (with the exception of @AndroidInjectionKey are now deprecated
dagger.android has a new format for binding AndroidInjector.Factorys:
AndroidInjector.Factory<? extends Activity> (or Service, Fragment, etc), return just AndroidInjector.Factory>@ActivityKey (or @ServiceKey, @FragmentKey, etc), use @ClassKey. The dagger.android map keys (with the exception of @AndroidInjectionKey are now deprecated@ContributesAndroidInjector, there's nothing to do. We have updated the output to match the new formatAndroidInjector.Factorys with dagger.android. See these docs for how to apply the refactoring to your codebase if you're on dagger-compiler-2.19. (02dc4a7f)Added @CancellationPolicy annotation, which can be used to make a production component or subcomponent allow cancellation of its subcomponent(s) to pr
@CancellationPolicy annotation, which can be used to make a production component or subcomponent allow cancellation of its subcomponent(s) to propagate up to it and cancel its nodes as well. (f5c04a54)void package.Class.<init>(params) to package.Class(params), which looks more like how Java users think of constructors. (d31943c2)@Provides and @Produces methods and component entry points instead of throwing IllegalArgumentException. (da2e1f02)dagger.android:
DaggerDialogFragment (47be5dbe)-Adagger.formatGeneratedSource=disabled (6814a218)-Adagger.gradle.incremental to javac (cd83b30f)Filer (baf23579)@BindsInstance. (5c69aab0)Deprecated dagger.android.DaggerFragment in favor of dagger.android.support.DaggerFragment to match Android P's deprecation of framework fragments.
@Binds @ChildScope method.@Binds method in a parent but used only from a child, whose dependency is missing in the parent but present in the child, used to result in a valid graph. Now an error is correctly added.dagger.android and you aren't already installing AndroidInjectionModule (or AndroidSupportInjectionModule), you should do so, otherwise you are likely to get a missing binding error from Dagger when you upgrade.-Adagger.android.experimentalUseStringKeys.dagger.android.DaggerFragment in favor of dagger.android.support.DaggerFragment to match Android P's deprecation of framework fragments. (a1bd0eab)@BindsOptionalOf methods. Dagger now reports an error for them. Instead of applying a scope to the @BindsOptionalOf method, apply it to the non-optional binding that satisfies the optional binding. (8852d0b3)Deprecate dagger.releasablereferences
dagger.releasablereferences (928b1572)@Module cycles will no longer crash the processor. (cd706912)DiagnosticReporter instead of returning ValidationItems. (1f4f6bc6)@Binds methods with inaccessible map keys crashed the processor. (ebf07420)dagger-android-processor to handle androidx typesFix a bug where binding collisions were not properly checked across subcomponent boundaries when a parent provided a concrete Set/Map and a child prov
Set/Map and a child provided a multibinding contribution with the same key.@BindsOptionalOf declarations.Provider<GeneratedType> might not have properly delayed processing until that type was generated (57a43dfd)dagger.spi package (in the com.google.dagger:dagger-spi artifact) so users can hook into the Dagger binding graph at build time to report custom validation or generate extra files at build time. Note that this is still experimental and the APIs may change. (120a3391)@Module elements. They never had a function and are now disallowed. (beeb29d6)DaggerBroadcastReceiver documentation with respect to when injection is performed (a49cee06)@Provides/@Produces methods in generic modules. (716dbcf2)FluentFuture is now a supported return type of @ProductionComponent and @Produces methods. (c98f88f9)Optional.<Foo>absent/empty() to fix a javac7 issue (83459f23)Fix a NoClassDefFound issue with 2.14
2.14 (4a202b77)Fix JPMS issue with javax.annotation types
An issue (#994) was discovered with this release - please use dagger-2.14.1 instead.
Reductions in code size - code for repeated bindings is now placed in private methods instead of duplicating it throughout the component
dagger.android speed improvements:
dagger.grpc - update to gRPC 1.8 (19cc9f4580b41efbba01492a768be86ab97a0d02)The following kind of bindings are now inlined in the generated components and do not need a Provider wrapper object (unless they are scoped or otherw
Provider wrapper object (unless they are scoped or otherwise requested as a Provider).
Sets and Maps
ImmutableSet/ImmutableMap too@Binds bindings@BindsInstance bindingsProvider objects are now removed from components, which should speed up initialization times!javac9Map multibindings are no longer in beta.
Map multibindings are no longer in beta.@ContributesAndroidInjector simplifies the usage of dagger.androidHasDispatching*Injectors are renamed to Has*Injector. They also return an AndroidInjector instead of a DispatchingAndroidInjectorDaggerApplication and DaggerContentProviderauto-common is properly shaded againdagger-android-processor works better with Gradle if you're not using dagger.android.supportdagger-grpcdagger-gwt is now being released again@GwtIncompatible is propagated to generated factoriesdagger-android-processor works better with Gradle if you're not using dagger.android.support
dagger-android-processor works better with Gradle if you're not using dagger.android.supportdagger-grpcdagger-gwt is now being released againMap multibindings are no longer in beta.
Map multibindings are no longer in beta.@ContributesAndroidInjector simplifies the usage of dagger.androidHasDispatching*Injectors are renamed to Has*Injector. They also return an AndroidInjector instead of a DispatchingAndroidInjectorDaggerApplication and DaggerContentProviderauto-common is properly shaded againRelease of `dagger.android` classes to simplify injection of Android core types
dagger.android classes to simplify injection of Android core typesbuild() methods to return a supertype of the component@BindInstance methods in their builders no longer generate a static create() method, since it would always be invalid.Add dagger.android support for Services and BroadcastReceivers
dagger.android support for Services and BroadcastReceiversAndroidInjector.Factorysjavac -g)dagger.android.processor can be used without dagger.android.support on the classpathNothing published for this version
Move AndroidInjection.inject() before invocation super.lifecycleMethod() Fixes #598
Fixes from 2.10-rc1:
AndroidInjection.inject() before invocation super.lifecycleMethod() Fixes #598dagger-android and dagger-android-support with an AndroidManifest.xmldagger and dagger-producers with -source 1.6 -target 1.6 so they can be used in Androiddagger-android-processor artifact addedRelease of dagger.android classes to simplify injection of Android core types
dagger.android classes to simplify injection of Android core typesThis is our first release using bazel instead of mvn. We don't believe there will be any noticeable differences, but if you see anything surprising please report an issue.
Faster compilation! With google-java-format 1.2, we have helped to fix a few performance bottlenecks which should result in less time in annotation pr
@BindsInstance for component builders to easily bind instances that are constructed outside of the graphProducerMonitor.ready(), which is called when all of a producer's inputs are available@Provides(type = ...) usage. Use the annotations in dagger.multibindings instead. @Produces.type was also removed@Component@Component.dependencies can no longer include @Modules.@Provides.Type is officially deprecated - see their javadoc for the appropriate alternatives. As per our Versioning docs, these will be removed in ~6…
@Components! We now inline many calls to @Inject constructors and @Provides methods when we don't need a Provider<T>.dagger-compilerjava.util.Optional support for @BindOptionalOfdagger-android artifact@Provides.Type is officially deprecated - see their javadoc for the appropriate alternatives. As per our Versioning docs, these will be removed in ~6 monthsenums, reducing code size for Android usersAdds `@BindsOptionalOf` for binding optionals
@Modules.subcomponents@BindsOptionalOf for binding optionals@Binds methods would crash the compilerCreate bindings for @Binds methods even when the RHS cannot be resolved
A few bugfixes
@Binds methods even when the RHS cannot be resolved
ProducerToken to use Class#getCanonicalName instead of Class#toString to avoid extra string allocations.@Provides methods are now allowed in @ProducerModules
@Provides methods are now allowed in @ProducerModulesProvider<Lazy<T>> can now be used to break dependency cycles.@Binds methods sometimes didn't contribute to multibindings in subcomponentsEnables @Binds usage with multibinding annotations (@IntoSet, @ElementsIntoSet, and @IntoMap)
@Binds usage with multibinding annotations (@IntoSet, @ElementsIntoSet, and @IntoMap)@Multibinds API to replace @Multibindings interfaces@Component.Builder methods for abstract modules are no longer allowed@IntoSet usage. Provided objects are no longer wrapped in a wasteful Collections.singleton()@Scopes are no longer allowed on @Produces methods@Produces method now generates 1 class instead of 2@Provides @IntoMap and @Produces @IntoMap valuesAdds `@Binds` API for delegating one binding to another
@Binds API for delegating
one binding to another@IntoSet, @ElementsIntoSet and @IntoMap to replace @Provides(type = ...) and @Produces(type = ...)Provider<Lazy<Foo>>@Scope annotation is applied to an @Inject constructorNoSuchMethodError from Issue #356Adds `@Reusable` scope (javadoc)
dagger.mapkeys moved to dagger.multibindings and all @MapKey implementations now correctly have @Beta applied
dagger.mapkeys moved to dagger.multibindings and all @MapKey
implementations now correctly have @Beta appliedCorrectly handle @Components that inject generated types
@Components that inject generated types@ProductionSubcomponent and @ProductionScopeExecutor to be bound with @Production@MapKey annotations to dagger.mapkeys. These annotations are
not, but should be marked @Beta (since the @MapKey itself is beta).A patch release, most crucially including:
A patch release, most crucially including:
A maintenance release fixing immediate issues following the Dagger 2.0 release, including:
A maintenance release fixing immediate issues following the Dagger 2.0 release, including:
@MapKey annotation types (beta)@MapKey annotations.The initial release of the 2.0 code-line, supporting:
The initial release of the 2.0 code-line, supporting:
@Component interfaces representing a custom API to access a graph of objects@Inject signals, @Qualifiers@Inject constructors and modules@Inject methods and fieldsStarting with Kotlin 2.0, kotlin-metadata-jvm library is promoted to stable, and is a part of Kotlin distribution now.
It means that it has the same versioning as Kotlin compiler and Kotlin standard library, and the same release cycle.
To achieve this, coordinates of the library were changed: it is now in org.jetbrains.kotlin group with kotlin-metadata-jvm id (notice
the drop of X from the coordinates).
This also means that the root package was changed from kotlinx.metadata to kotlin.metadata.
Among other noticeable changes, all previously deprecated declarations were removed from the library. In case you need to perform a migration with aid, migrate your project to 0.9.0 version first using migration guide.
This is the last entry of this changelog. General changelog for Kotlin's Libraries subsystem is available in the ChangeLog.md at the repository root.
One column per quarter.