‘by viewModels’ not recognized in AppcompactActivty
When I try to initialize viewmodel in an Activity which extends ComponentActivity, I can use “by viewModels(..)” . However if I try to instantiate the same in an activity that extents AppCompactActivity, it remains unresolved.