-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@ViewModelInject has deprecated #12
Comments
Yea, I've got similar issue. I've checked annotations everywhere and they are fine. idk what's wrong and keep investigating this issue |
Finally i got solution! See this link with sample project, which shows how to inject VM with Hilt: And here I'll also post my changes in project: build.gradle:Project
build.gradle:Module
AppModule
and TasksViewModel
|
Hi,
@ViewModelInject has deprecated. I change to the following and I still got an error.
"java.lang.RuntimeException: Cannot create an instance of class com.example.room_test.ui.tasks.TasksViewModel"
Is there a way I can solve the problem? Many thanks.
KC
@HiltViewModel
class TasksViewModel @Inject constructor(
private val taskDao: TaskDao
) : ViewModel() {
}
The text was updated successfully, but these errors were encountered: