Skip to content

Releases: google/dagger

Dagger 2.44.2

14 Nov 18:53
Compare
Choose a tag to compare

Whatโ€™s new in Dagger

Bug fixes

  • Fixes #3633: Updated shading rules to include newly added classes in androidx.room.compiler to prevent class version conflicts with user dependency on Room.

Dagger 2.44.1

11 Nov 17:45
Compare
Choose a tag to compare

Whatโ€™s new in Dagger

Bug fixes

  • Fixes #3619: Upgrades XProcessing jars to get upstream fix for enums in annotations (which were missing fully qualified name or import in generated code).

Dagger 2.44

21 Sep 20:00
Compare
Choose a tag to compare

Whatโ€™s new In Dagger

Potentially breaking changes

  • Fixes #3531: Removed formatting from dagger.android generated source could be a breaking change for anyone relying on golden files for Daggerโ€™s generated code. (d123efd)

Bug Fixes

  • Fixes #3522: Avoids pre-validating the nearest enclosing type in the InjectProcessingStep. (1d74d1f)

Whatโ€™s new in Hilt

Potentially breaking changes

  • Added ViewModelLifecycle. This can be injected in the ViewModelComponent and used to register listeners for when ViewModel#onCleared() is called. This change also includes a breaking change for anyone who implemented the ActivityRetainedLifecycle interface themselves. This should be rare though as this interface was not meant to be implemented by users. (55aa4c6)

Bug Fixes

  • Fixes #3478: Fixes an issue in Hilt's Gradle Plugin not configuring the aggregating task correctly on a com.android.test Gradle module. (ea39850)

Dagger 2.43.2

03 Aug 20:55
Compare
Choose a tag to compare

Whatโ€™s New In Dagger

Bug Fixes

  • Fixes #3495: Updates the XProcessing jars, which should again be compatible with java 8. (62b7f45)
  • Adds support reading metadata from Kotlin 1.8 by updating kotlin-metadata-jvm to 5.0. (353a50b)
  • Fixes an issue where the Hilt Gradle Plugin artifact was being bloated with additional classes causing its size to be way bigger than its suppose to be. (8235beb)

Dagger 2.43.1

29 Jul 17:33
Compare
Choose a tag to compare

Whatโ€™s New In Dagger

Bug Fixes

  • Fixes #3480. Replace dependency on javax.annotation:jsr250-api:1.0 with javax.annotation:javax.annotation-api:1.3.2. (e9dc377)
  • Fixes #3483: Add onPluginEnd to BindingGraphPlugin, which will be called after all BindingGraphPlugins have been visited (3445275)
  • Fixes #3476: Fix issue with Dagger generating mismatching parameter names in component inject functions. (90300d9)

Dagger 2.43

21 Jul 20:45
Compare
Choose a tag to compare

Whatโ€™s New In Dagger

Potentially Breaking Changes

Bug Fixes

  • Fixes #3401 where Dagger generated mismatched parameter names in subcomponent factory method implementations when the original factory method is in a separate build unit from the component that implements it.

Whatโ€™s New In Hilt

Potentially Breaking Changes

  • Hilt now throws if the base activity/fragment classโ€™s getDefaultViewModelProviderFactory() returns null. This is unlikely to happen though unless overridden by the user to return null. (9eee8e4)
  • As part ViewModel bug fixes, dependencies were updated as below. androidx.navigation users will need to update to 2.5.0 to interoperate. These libraries require building with SDK 31. To build with SDK 31, AGP users will need to use AGP 7.0+. This will also require using JDK11.
    • androidx.activity and androidx.fragment to 1.5.0
    • androidx.lifecycle to 2.5.0
    • androidx.savedstate to 1.2.0

Bug Fixes

  • Fix #3464 where SPI plugins were not being invoked with Hilt's Gradle Plugin aggregation (enableAggregatingTask) turned on. (b838876)
  • Fixes #2328 and #3232 where getting multiple instances of @HiltViewModel with different keys would cause a crash.
  • Fixes #2152. hiltNavGraphViewModels is now no longer necessary to use @HiltViewModel with navigation backstack entries as the owner. The default ViewModelProvider.Factory from activities and fragments can be used directly with the backstack entry as the owner. (74ea765)
  • Make it so that map keys used with @BindValueIntoMap in Kotlin code do not need to use the @field notation. (e591833)

Dagger 2.42

09 May 21:10
Compare
Choose a tag to compare

Whatโ€™s new in Dagger

Potentially breaking changes

As of this release, Daggerโ€™s generated class will no longer extend the user-defined @Component annotated class (885b16d). This change was done to improve build times in certain scenarios by avoiding a known javac bottleneck. However, it may also be a breaking change for some users. For example

// This will fail as of Dagger version 2.42
DaggerMyComponent component = DaggerMyComponent.create();

// Do this instead:
MyComponent component = DaggerMyComponent.create();

For migration purposes, weโ€™ve added a temporary javac flag that can be used to re-enable the legacy behavior (the flag is disabled by default).

-Adagger.generatedClassExtendsComponent=ENABLED

This flag will be removed in a future version of Dagger.

Whatโ€™s new in Hilt

Bug fixes

  • Fix two issues (e3d4468):
    1. matchingFallbacks being ignored work with Hilt.
    2. Hilt causing jetifier to execute twice.
  • Allow Hilt view constructor to contain non-declared types. (dc76e82)
  • Fix #3222. Generated fragment code previously would cause a Lint issue around LayoutInflater.from(). (850fc84)
  • Fix #3329 where modules in a package with non-standard capitalization could cause an error in the Hilt Gradle Plugin. (029fe57 and 329915f)

Dagger 2.41

16 Feb 22:04
Compare
Choose a tag to compare

Whatโ€™s New In Dagger

Potentially Breaking Changes

  • This release fixes a recently noticed, but long-standing bug (#3136) where Daggerโ€™s processors may silently miss a scope/qualifier on a binding if the scope/qualifier annotation is unresolvable (i.e. it is not on the classpath).

    Dagger will now prefer to fail the build if there are any unresolvable annotations present where a scope/qualifier is allowed. While Dagger does its best to avoid failing the build for non-scope/qualifier annotations, in general itโ€™s not possible to tell if an annotation is a scope/qualifier unless its type is resolvable -- thus, Dagger may fail on non-scope/qualifier annotations as well.

    If these changes break your build, we recommend first trying to fix the breakage by adding the appropriate missing dependencies to your build (in most cases the error message should tell you exactly what type is missing). Although not recommended, you can revert back to the old behavior using the compiler option -Adagger.strictSuperficialValidation=DISABLED; however, this option will be removed in a future release. If the breakage is specifically due to the validation of transitive component dependencies, you may choose to disable that validation using -Adagger.validateTransitiveComponentDependencies=DISABLED. If the breakage is specifically due to androidx.hilt:hilt-lifecycle-viewmodel you will need to migrate to the native Hilt API (see #3257 (comment)).

  • This release fixes an accidental regression (introduced in Dagger version 2.39) that allowed requesting a raw @Inject constructor type which was previously not allowed (a61aa50).

    We expect breakages due to this issue to be relatively rare and easy to fix -- just replace the raw type with the proper parameterized type.

  • The string format of bindings has changed slightly (just spacing). SPI plugins that depend on this format may break. Note that as KSP migrations go forward, other string formats may change slightly in similar ways as well.

New Changes

  • Dagger error messages for unresolvable deferred types have been improved. Error messages now tell you exactly which type could not be resolved and where it was found. Fixes #โ€‹โ€‹2208 (727068f), Fixes #3133 (78646fb)

  • Dagger now supports reading the jakarta.inject versions of Inject, Scope, Qualifier, and Singleton. Dagger currently does not support jakarta.inject.Provider. Also, code generated by Dagger (and Hilt) continue to use the javax.inject symbols. Further changes and support to come in future releases. (2195513)

Bug Fixes

  • Updates dagger-lint to avoid displaying a warning due to missing Vendor information. (cb33cc5)
  • Fixes an issue where Dagger's lint checks wouldn't work with lint 30.2.x-alpha due to using a removed API. (33ba899)
  • Fix #3069 where a class named "Create" could cause a conflict with the create() method on a component. (5ba04fb)
  • Fix #3143 where a crash about a missing shard would occur when a members injection binding exists in a parent component. (3545f01)
  • Fix #3091. Update MapKey error message to reference new auto-value artifacts. (91e7df1)

Whatโ€™s New In Hilt

New Changes

Bug Fixes

  • Fix an issue where Hilt transform was not correctly updating the Signature attribute of an @AndroidEntryPoint whose superclass contained a type variable. (475cc05)
  • Fixes #3119: Added kotlin-stdlib to pom dependencies to avoid breaking java-only projects. (3ec422e)
  • Support AGP 7.2 ASM API changes (5502cd7)

Dagger 2.40.5

06 Dec 22:24
Compare
Choose a tag to compare

Dagger bug fixes

  • Fixes #3090. Fixes an issue where the superficial validation for inject types was validating deeper than necessary and triggering failures when some classes were not available in the compile classpath.

Dagger 2.40.4

02 Dec 17:26
Compare
Choose a tag to compare

Whatโ€™s New in Dagger

Bug Fixes

Fix #3075: Fixes an issue where we were not deferring processing for a generated type in Kotlin source (745d30c)