Dagger2 v2.30.1 Release Notes

Release Date: 2020-11-24 // 11 months ago
  • 🐛 Bug fixes

    • 🚀 Sets the default value for experimentalDaggerErrorMessages back to disabled since it breaks hyperlinks in AndroidStudio (6a8bbbf) . Note that this reverses the change to the default value made in the release 2.30.
    • 🛠 Fixes #2190: Dagger was unnecessarily inspecting all fields of a class and attempting to find their Kotlin metadata, which sometimes led to crashing the processor. Now, Dagger inspects the Kotlin metadata lazily, and only on the fields that require it. (a885c85)

Previous changes from v2.30

  • What’s new

    Hilt

    🚀 Hilt has deprecated ApplicationComponent (6313cbd), and it will soon be removed in a future release. Use SingletonComponent instead.

    👍 Hilt now supports @BindValue val fields in Kotlin without the use of @JvmField (802882d). For example:

    // [email protected] @JvmField val bindStr = "STRING\_BINDING"// [email protected] val bindStr = "STRING\_BINDING"
    

    Dagger

    👀 Dagger now uses the “experimentalDaggerErrorMessages” by default (See #1769 for more information). The old error message format can still be used by setting -Adagger.experimentalDaggerErrorMessages=disabled as a javacopt.

    🐛 Bug Fixes

    • 🛠 [Dagger]: Fixes a Dagger compiler crash that occurred when an @Inject was placed in a Kotlin object class. (0816c43)
    • ⚡️ [Hilt]: Fixes #2156: Update Dagger's androidx dependencies to the latest stable versions. (deff5e5)
    • 🗄 [Hilt]: Fixes suppress deprecation warning in Hilt generated Fragment class. (0a463eb)
    • 🚚 [Hilt]: Removes Hilt's dependency on jsr250 for @Generated. (8dca74b)
      Note: Hilt previously depended on jsr250 for the @Generated annotation, but this behavior has now been changed to match Dagger (see #95). Now, Hilt only adds the @Generated annotation only if the Generated class is present in the classpath. Thus, since we’ve now removed the jsr250 dependency from Hilt, the generated code will no longer contain the @Generated annotation by default.