-
Notifications
You must be signed in to change notification settings - Fork 11
Adopt Hilt 2.41 #31
Adopt Hilt 2.41 #31
Conversation
|
@@ -26,7 +26,7 @@ object Plugins { | |||
const val kotlinParcelize = "kotlin-parcelize" | |||
const val androidLibrary = "com.android.library" | |||
const val androidApplication = "com.android.application" | |||
const val hilt = "dagger.hilt.android.plugin" | |||
const val hilt = "com.google.dagger.hilt.android" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Hilt Gradle Plugin now supports the updated Gradle plugins DSL as described in https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block via its new id: com.google.dagger.hilt.android. (google/dagger@e50aa06)
val hilt = arrayOf( | ||
"com.google.dagger:hilt-android:$hiltVersion", | ||
"androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration steps:
Users of @ViewModelInject can migrate to @HiltViewModel which was added in Dagger 2.31.
Add @HiltViewModel annotation to the class
Replace the @ViewModelInject annotation on the constructor with @Inject.
Remove @Assisted from the SavedStateHandle constructor parameter, if it exists
Remove the old androidx.hilt:hilt-lifecycle-viewmodel dependency from your build.gradle file
https://github.com/google/dagger/releases/tag/dagger-2.41