Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Adopt Hilt 2.41 #31

Merged
merged 3 commits into from
Feb 17, 2022
Merged

Adopt Hilt 2.41 #31

merged 3 commits into from
Feb 17, 2022

Conversation

Goooler
Copy link
Owner

@Goooler Goooler commented Feb 17, 2022

@Goooler
Copy link
Owner Author

Goooler commented Feb 17, 2022

ComponentProcessingStep was unable to process 'io.goooler.demoapp.DemoApplication_HiltComponents.SingletonC' because 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' could not be resolved.

google/dagger/issues/3257

@@ -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"
Copy link
Owner Author

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)

Comment on lines -85 to -88
val hilt = arrayOf(
"com.google.dagger:hilt-android:$hiltVersion",
"androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
)
Copy link
Owner Author

@Goooler Goooler Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google/dagger#3257 (comment)

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

@Goooler Goooler merged commit 423d675 into kotlin Feb 17, 2022
@Goooler Goooler deleted the hilt branch February 17, 2022 07:12
@Goooler Goooler added build dependencies Pull requests that update a dependency file labels Feb 17, 2022
@Goooler Goooler added this to the 1.5.0 milestone Feb 17, 2022
This was referenced Feb 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant