When trying to get a reference to the viewModel from the fragment, I get the following error: "Type 'Lazy<TypeVariable(VM)>' has no method 'getValue(LoginTabFragment, KProperty<*>)' and thus it cannot serve as a delegate". The following image is of my fragment:
CodePudding user response:
Check if your LoginViewModel class is extending the ViewModel or not.
CodePudding user response:
Make sure that you have already added this dependency to your gradle
implementation "androidx.fragment:fragment-ktx:$fragment_version"
and according to this the current stable version is 1.3.6