Reputation: 207
I have problem after adding a new phone & tablet module in my project.
I get an error massage like this:
Cannot access 'androidx.lifecycle.HasDefaultViewModelProviderFactory' which is a supertype of 'com.example.favoriteuser.MainActivity'. Check your module classspath for missing or conflicting dependecies.
Upvotes: 2
Views: 271
Reputation: 361
Add the following dependencies to module-level build.gradle file
implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'
implementation "androidx.lifecycle:lifecycle-viewmodel:2.2.0"
Upvotes: 1