Skip to content

Releases: google/dagger

Dagger 2.58

15 Jan 23:11

Choose a tag to compare

Note: AGP 9 support was held back from this release (0a5b42c) because it forces users onto AGP 9. It will be available in the next Dagger release (e92e3f3).

Potential breaking changes:

  • Flipped default for dagger.useBindingGraphFix to enabled (d41e836).
    See https://dagger.dev/dev-guide/compiler-options#useBindingGraphFix.
    Fix: If this change breaks you it’s likely due to providing a binding in an incorrect module, (e.g. the binding requests an Activity but is installed in the SingletonComponent). The fix is to move the @Provides so that it is installed into the correct component (e.g. the ActivityComponent instead of SingletonComponent). You can also set dagger.useBindingGraphFix=disabled but note that this flag is only temporary and will eventually be removed.
  • The use of abstract var in components is now banned in super types.
    The reason for this change is that an abstract var property creates both a getter and a setter on the component which is almost always unintentional.
    Fix: If this change breaks you, use either an abstract val foo: Foo if you need a getter or abstract fun inject(foo: Foo) if you need an inject method. Note that abstract var is already banned if it is declared directly on the @Component class/interface, but this change fixes the check so that it’s banned even if it’s inherited from a super type.

Bug fixes/features:

  • Fixes #1116, #1630, Supported Map<K, Lazy<V>> as a multibinding request type. (7f981a4)
  • Fixes #3601. No longer adds a deprecation warning for unused dependencies on setters on the component builder. (1cf9dfc)
  • Fixes #4982:
    • Added validation to prevent using Java keywords in Dagger-generated code (72e21a8)
    • Added error for binding elements names that are Java keywords. (38071c5)
    • Java keyword validation is now performed earlier during the superficial validation stage. (7f6f7bd)

Dagger 2.57.2

25 Sep 23:34

Choose a tag to compare

Bug fixes

  • Fixed #4847: Fixed an issue with the Hilt Gradle Plugin registered transforms on projects using Gradle 9.0.0 (ea570e7)
  • Fixes #4898: Fixed an issue with backwards compatibility handling for libraries that export Hilt roots. (85c470c)
  • Fixes #4937: Fixed the incorrectly declared version of the Kotlin stdlib dependency in the Hilt Gradle Plugin. (deefd9a)
  • Updated ASM dependency to 9.8 (365bc49)

Dagger 2.57.1

20 Aug 21:16

Choose a tag to compare

Bug fixes

  • Fixes #4734: Updated Hilt's Gradle Plugin detection of AGP to maximize compatibility and avoid the confusing 'The Hilt Android Gradle plugin can only be applied to an Android project.' error when the plugin is on an Android project. (20adecb)
  • Fixes #4848: Set coreLibrariesVersion for the Kotlin compilation of the Hilt Gradle Plugin to further improve backwards compatibility. (00c7fc2)
  • Fixes #4848: Use api / language versions for the Kotlin compilation of the Hilt Gradle Plugin to not force projects to update to Kotlin 2.2.0, the current version used by the plugin. (58e4992)
  • Fixes #4780: Add support for the Jakarta Singleton annotation in Hilt. (ec7f76f)
  • Fixes #4917: Removes the explicit dependency to androidx.annotation:annotation-jvm and to a beta version of it. (092a85a)
  • Limit number of similar bindings shown in error messages to 20 (59ac2f9)
  • Update wording for @AssistedInject error to be more specific. (1702e79)

Dagger 2.57

17 Jul 18:46

Choose a tag to compare

Potential breaking changes

The generated Factory/MembersInjector constructors have changed from public to private. This shouldn’t affect most users since these classes are only meant to be called by Dagger’s other generated code. If you do happen to be broken by this change, you should avoid calling Dagger’s generated Factory/MembersInjector classes directly. For a temporary solution, you can also switch to using the public static methods to create an instance. (165cf20)

Bug fixes

Fixes #4779. Unshades the Kotlinx Metadata to support Kotlin 2.2.0 (bfa88b9)

Dagger 2.56.2

16 Apr 21:09

Choose a tag to compare

Bug fixes

  • [Dagger] Fixes #4676: Fixes IndexOutOfBoundException when returning suspend from @Provides method. (5d59aed)
  • [Dagger] Fixes #4658: Fixes NoSuchMethodError due to incorrect Guava runtime (Dagger’s Guava version is now temporarily pinned to 33.0.0 to avoid the issue). (9fc3df4)

Dagger 2.56.1

25 Mar 20:33

Choose a tag to compare

Bug fixes

  • [Dagger] Fixed #4624: Shade Dagger's javapoet-kotlinpoet dependency.

Dagger 2.56

19 Mar 20:16

Choose a tag to compare

Notable/breaking changes

  • [Jakarta support] Remove deprecated Factory create methods that take a javax.inject.Provider. This means components built with an older Dagger version but with factory dependencies from a newer Dagger version will no longer compile. If you run into this, the Dagger version compiling the component must be upgraded. (3412e6c)
  • [Jakarta support] Disallow providing or injecting dagger.internal.Provider. Also disallow injections of raw Provider in Maps, for both javax and dagger Providers. (962bb33)
  • [Dagger]: Usages of @Multibinds and @ElementsIntoSet in Kotlin sources must now use Set/Map from the kotlin.collections package rather than the java.util package.

Bug fixes

  • [Jakarta support] Add support for Jakarta annotations to Hilt. (9001b55)
  • [Jakarta support] Fixed #4572. Fix issue with jakarta.inject.Provider support where in certain cases requests for a Map<K, Provider<V>> would fail to compile. (f4e8003)
  • [Dagger] Remove private modifier from fields/methods within generated Dagger component's private implementation classes (see #4544). (79f8633)
  • [Hilt] Partially Fixed #4423: Fix project isolation violation when checking that Hilt libraries are applied along the Gradle plugin. (91450da)
  • Kotlin was upgraded to 2.1.10 to support KSP 2.1.10-1.0.31. This breaks compatibility older Gradle versions (8.10.2 or below). pre-compiled script plugins (included builds) using Hilt Gradle Plugin will fail to compile.

Dagger 2.55

09 Jan 21:17

Choose a tag to compare

Notable/breaking changes

  • Added support for injecting jakarta.inject.Provider. This should be usable anywhere javax.inject.Provider is usable. Note that this technically comes with a breaking change to disallow providing jakarta.inject.Provider types in the same way it is disallowed for javax.inject.Provider. (caa7e17)
  • Fixed a number of binding graph related issues.
    These fixes can be enabled with, -Adagger.useBindingGraphFix=ENABLED, but due to this sometimes being a breaking change we’ve set the default behavior to β€œdisabled” for now. We will flip the default to β€œenabled” in a future release, and eventually remove the flag altogether. Enabling this feature can fix a number of confusing error messages. See https://dagger.dev/dev-guide/compiler-options#useBindingGraphFix for more details.

Bug fixes

  • Fixed #4549: Fixed incremental processing for LazyClassKey proguard files by adding the
    originating element to the writeResource call. (98a0275)

Dagger 2.54

20 Dec 19:31

Choose a tag to compare

Bug fixes

  • Fixed #4303: Upgrade Hilt Gradle Plugin to support KSP2 configuration. (76b5819)
  • Fixed #4544: Removes private from InstanceHolder field to avoid unnecessary accessor method. (07d8f88)
  • Fixed #4533: Fixes path separator for Windows when creating LazyClassKey proguard file. (efa421a)

Notable changes

  • In preparation for jakarta support, Dagger’s generated factories now include a create() method that uses dagger.internal.Provider rather than javax.inject.Provider. For now, the javax.inject.Provider create() method is also kept for compatibility, but it will be removed in a future release. When that happens, libraries built with the newer version of Dagger may break downstream users of @Component that are built with an older version of Dagger. (d60729d)

Dagger 2.53.1

09 Dec 18:10

Choose a tag to compare

Bug fixes

  • Fixes #4525: Update kotlin-jvm-metadata to 2.0.21 to remove dependency on Beta version. (84d3aa5)
  • Fixes #4526: Add the originating element in LazyMapKeyProxyGenerator. (5fd8ec1)