I have recently upgraded my android studio to version 3.2, and since everywhere I try to access fragment/activity attributes from my ViewModel classes, I get this "Cannot access android.arch.lifecycle.ViewModelStoreOwner" message:
It does not affect compilation, but this annoying message pops in a lot of class.
Any ideas?
PS: I have already tried "Invalidate caches and restart" several times
Just got the same problem after update, this helped: Add this line to your module’s build.gradle script:
dependencies {
...
implementation 'android.arch.lifecycle:extensions:1.1.1'
}
Found it here: Adding Components to your Project
I have faced the same issue and I resolved this issue by updating android support libraries in build.gradle file.
I would recommend updating your android support libraries to 27.1.1 or newer. No need to add this :
implementation 'android.arch.lifecycle:extensions:1.1.1'
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