Releases: google/dagger
Releases Β· google/dagger
Dagger 2.58
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.useBindingGraphFixtoenabled(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@Providesso that it is installed into the correct component (e.g. the ActivityComponent instead of SingletonComponent). You can also setdagger.useBindingGraphFix=disabledbut note that this flag is only temporary and will eventually be removed. - The use of
abstract varin components is now banned in super types.
The reason for this change is that anabstract varproperty creates both a getter and a setter on the component which is almost always unintentional.
Fix: If this change breaks you, use either anabstract val foo: Fooif you need a getter orabstract fun inject(foo: Foo)if you need an inject method. Note thatabstract varis already banned if it is declared directly on the@Componentclass/interface, but this change fixes the check so that itβs banned even if itβs inherited from a super type.
Bug fixes/features:
Dagger 2.57.2
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
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
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
Dagger 2.56.1
Bug fixes
- [Dagger] Fixed #4624: Shade Dagger's javapoet-kotlinpoet dependency.
Dagger 2.56
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
@Multibindsand@ElementsIntoSetin Kotlin sources must now use Set/Map from thekotlin.collectionspackage rather than thejava.utilpackage.
Bug fixes
- [Jakarta support] Add support for Jakarta annotations to Hilt. (9001b55)
- [Jakarta support] Fixed #4572. Fix issue with
jakarta.inject.Providersupport where in certain cases requests for aMap<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
Notable/breaking changes
- Added support for injecting
jakarta.inject.Provider. This should be usable anywherejavax.inject.Provideris usable. Note that this technically comes with a breaking change to disallow providingjakarta.inject.Providertypes in the same way it is disallowed forjavax.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
Dagger 2.54
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 usesdagger.internal.Providerrather thanjavax.inject.Provider. For now, thejavax.inject.Providercreate()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@Componentthat are built with an older version of Dagger. (d60729d)