by viewModels() not resolving in Android Studio
I have the following dependencies in
I have found lots of conflicting info regarding the correct dependencies to use here when I googled for more info. Advice is welcome. Thanks.
Make sure that you have synced your changes with Gradle. If Android Studio still can’t find the import after that, you can add it in manually. It is:
Thanks, but I still cannot get this to work. Curious if others are encountering this same issue while working through the book.
What versions of those libraries are you using? The Gradle code that you provided at the beginning is missing the versions of each library. The full lines should be: