Dagger 2 v2.30 Release Notes

Release Date: 2020-11-20 // about 1 year ago
  • What’s new


    🚀 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 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.