Skip to content

Dagger 2.43

Compare
Choose a tag to compare
@Chang-Eric Chang-Eric released this 21 Jul 20:45
· 462 commits to master since this release

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)