I am trying to write a sample app using Android architecture components and but even after trying for days I could not get it to work. It gives me the above exception.
Make sure your ViewModel has constructor with only one parameter i.e. Application.
ViewModel
Application
example:
public YourViewModel(Application application) { super(application); ...