I am using jetpack and I need to use my view model...
# android
a
I am using jetpack and I need to use my view model there as viewModel: HomeViewModel = hiltViewModel() but the hiltViewModel() is giving an error as Unresolved references
a
hiltViewmodel is provided by hilt as a separate dependecy
have you added it ?
a
yes def hilt = "2.37" implementation "com.google.daggerhilt android$hilt" kapt "com.google.daggerhilt compiler$hilt"
I have added it in app.build.gradle
a
Copy code
implemenntation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
cann you add that. ?
to
app.build.gradle
as well
a
let me try
I have added it but same issue persists
I did a clean rebuild
👍 1