Skip to content

Releases: google/dagger

Dagger 2.26

30 Jan 00:35

Choose a tag to compare

What's new

  1. Fix #1700: Remove usages of non-Android Guava APIs. (0925e8f)
  2. Fix #1720: Fix incremental dagger-android-processor in kapt when using dagger.android.experimentalUseStringKeys. (6a0ce58)
  3. Fix #1721: Migrate dagger-android to AndroidX. (f45213e)
  4. Better support for binding declarations within Kotlin companion objects of @Module annotated classes. (8190c7c)

Known breaking changes

Companion object modules are no longer allowed on Component#modules list (8190c7c)

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 (f45213e)

The following artifacts have been migrated from the support library to AndroidX:

  • com.google.dagger:dagger-android:2.26
  • com.google.dagger:dagger-android-support:2.26

This 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.26
  • com.google.dagger:dagger-android-support-legacy:2.26

Dagger 2.25.4

27 Dec 18:24

Choose a tag to compare

What's new

Bug fixes

Dagger 2.25.3

16 Dec 23:33

Choose a tag to compare

What's new

  1. Bug fixes

    1. Fix #1659: Add workaround for missing Kotlin qualifiers annotations across compilation units. (c96fc3e)
    2. Fix #1648: Kotlin object module providers of a primitive type would fail to compile (d0dfab8)
    3. Fix #1645: Improve memory footprint when parsing Kotlin metadata by using the visitor APIs. (f4f6d18)
  2. Maintenance

    1. Bump Android API to 29 and build tools to 29.02. Also bazel 1.1.0. (5e7374e)
    2. Add gradle build test to the release script to test maven artifacts build. (e80e4b1)

Dagger 2.25.2

23 Oct 21:06

Choose a tag to compare

Known breaking changes

  • 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 @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.

What's new

  1. Bug fixes

    1. Fix duplicate missing binding error messages. (2411074)
    2. Fix dagger-spi pom file from dependency cycle. (3699697)
    3. Fix issue with missing shaded deps from release 2.25 (efe1b00)
  2. Kotlin support

    1. Qualifier annotations on fields can now be understood without
      The need for @field:MyQualifier (646e033)
    2. @Module object classes no longer need @JvmStatic on the
      provides methods. (0da2180)
  3. Performance Improvements

    1. Build performance:
    2. Runtime performance:
      • _Factory proxy methods can now be accessed without
        class loading the factory (a258d37).

Dagger 2.25

22 Oct 20:32

Choose a tag to compare

Do not depend on this release.

Depend on release 2.25.2 instead, which fixes issue #1639.

Dagger 2.24

25 Jul 23:39

Choose a tag to compare

  • Deprecations/removals
    • 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. (3bd8f70)
  • Bug fixes
    • Duplicate keys were erroneously not detected when MapKey.unwrapValue=false which may have resulted in a runtime error (depending on whether fastInit mode was used). This is now detected and failed at compile time. (8b5dbea)
  • Build performance
    • Gradle's incremental annotation processing is now enabled for all builds (50bc180)

Dagger 2.23.2

19 Jun 14:33

Choose a tag to compare

In addition to the 2.23.1 release notes, this release:

  • Fixes a bug where an @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: a11605c)
  • Suppresses all unchecked/rawtypes warnings in Dagger generated code (ce23333)

Dagger 2.23.1

30 May 14:53

Choose a tag to compare

In addition to the 2.23 release notes, this release fixes support for gradle incremental annotation processing (a91d962)

Dagger 2.23

28 May 22:01

Choose a tag to compare

  • Validation/strictness
    • Generated components are no longer public unless the component type is public (298dea8)
    • @BindsInstance annotations are now more strictly validated (d3ed46d)
  • Build performance
    • Generated code is no longer formatted by default. Use -Adagger.formatGeneratedSource=enabled to turn it on. (fcd069c)
    • General build performance improvements (7e374b5)
  • Android
    • Added dagger.android.HasAndroidInjector, which will soon replace the Has*Injector interfaces. This one interfaces coalesces the others and should be functionally equivalent. (8f01526)
  • Full Binding Graph Validation
    • Rename -Adagger.moduleBindingValidation to -Adagger.fullBindingGraphValidation. The old name continues to work as an alias. (add5a74)
    • Do full binding graph validation for components and subcomponents, not just modules. (15d20f8)
  • Bug Fixes
    • Fixed an issue where @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). (8051d28)

Dagger 2.22.1

03 Apr 00:26

Choose a tag to compare

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). (8051d28)