Extend the functionality of Dagger Hilt to enable dependency injection of certain classes from the androidx libraries.

This table lists all the artifacts in the androidx.hilt group.

Artifact Current Stable Release Next Release Candidate Beta Release Alpha Release
hilt 1.0.0 - - -
hilt-navigation-compose - - - 1.0.0-alpha02
This library was last updated on: May 5, 2021


Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Hilt-Navigation-Compose Version 1.0.0

Version 1.0.0-alpha01

March 10, 2021

androidx.hilt:hilt-navigation-compose:1.0.0-alpha01 is released. Version 1.0.0-alpha01 contains these commits.

New Features

  • The :hilt-navigation-compose artifact provides APIs that allow users to get a @HiltViewModel annotated ViewModel from a Navigation back stack entry within a Compose application using :navigation-compose. The function hiltNavGraphViewModel() can either take a NavBackStackEntry or a 'route' string that can be used to scope the ViewModel to either the current back stack entry or to a parent entry in the stack. (Ia9234)

Version 1.0.0

Version 1.0.0

May 5, 2021

androidx.hilt:hilt-*:1.0.0 is released. Version 1.0.0 contains these commits.

Major features of 1.0.0

The androidx.hiltartifacts offers extensions for integrating Hilt with various other AndroidX libraries, such as WorkManager and Navigation. To see a list of features and examples check out the integration documentation.

Version 1.0.0-beta01

March 10, 2021

androidx.hilt:hilt-*:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.

API Changes

  • Remove @Deprecated types from the AndroidX Hilt artifacts, specifically @androidx.hilt.ViewModelInject and @androidx.hilt.Assisted. Note that @ViewModelInject was replaced by @HiltViewModel. (I626fe)

Version 1.0.0-alpha03

January 27, 2021

androidx.hilt:hilt-*:1.0.0-alpha03 is released. Version 1.0.0-alpha03 contains these commits.

New Features

  • Provide APIs for retrieving @HiltViewModel annotated ViewModel from a Navigation NavBackStackEntry. The artifact hilt-navigation-fragment offers a hiltNavGraphViewModels Kotlin extension while hilt-navigation exposes a HiltViewModelFactory factory method that takes in a NavBackStackEntry as argument and returns a ViewModelProvider.Facctory that can be used with ViewModelProvider or other View Model retrieving APIs, such as Compose’s viewModel() function: viewModel(HiltViewModelFactory(AmbientContext.current, backStackEntry)). (I00e67)

API Changes

  • Replace @WorkerInject with @HiltWorker. @HiltWorker is now a type annotation and requires the usage of @AssistedInject in the constructor. (Ic2f15)
  • Deprecate @ViewModelInject. Equivalent functionality is now offered by @HiltViewModel, which is now part of the core Hilt Android APIs. (I36a41)

Bug Fixes

  • Fix an issue where AndroidX Hilt extension Modules would not get correctly picked up by Hilt causing Workers to not be available for creation. (I3181c, b/159540434)
  • Migrate AndroidX Hilt extensions to the SingletonComponent, removing the deprecated warning of using ApplicationCompoonent. (I9c916, b/175849092)

Version 1.0.0-alpha02

July 22, 2020

androidx.hilt:hilt-*:1.0.0-alpha02 is released. Version 1.0.0-alpha02 contains these commits.

Bug Fixes

  • Fixed an issue of duplicate saved state keys when a non-Hilt injected ViewModel was requested from an @AndroidEntryPoint-annotated class. (b/158737069)
  • Fixed an issue in HiltWorkerFactory where it wouldn’t correctly initialize nested Worker classes annotated with @WorkerInject. (b/160524718)

Version 1.0.0-alpha01

June 10, 2020

androidx.hilt:hilt-*:1.0.0-alpha01 is released. Version 1.0.0-alpha01 contains these commits.

The androidx.hilt package and libraries extend the functionality of Dagger Hilt to enable dependency injection of certain classes from the androidx libraries.