I'm no expert but i have a line of code that solved my problem in Java. Hope this helps someone.
viewModel =
new ViewModelProvider
.AndroidViewModelFactory(getApplication())
.create(ViewModel.class);
As i said i would love to provide more details, but this fixed this problem for me.