I'm using hiltViewmodels. However, this error only appears when attempting to instantiate my viewModel in the library module compiled code. I'm using this compiled code in the form of an aar file that is depended on by a different app module.
The Hilt viewModel dependency injection works great in my original project.
( val viewModel: FeedViewModel by viewModels() )
I had the same Exception, and managed to fix it in Android Studio.
Just clean the project: Open the "Build" menu and click on "Clean Project".
Now running the app should work again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With