Reputation: 1
It shows the issue It shows the error that occurs
Guys Im getting this error while importing the viewModel,then when I checked in the build.gradle.kts file with the help of chat gpt , the dependency for the viewModel was not there,though I added it and also added the declaration to the version catalog,even after doing all these,am not able to get the import for the viewModel,Well I'm using the latest version of Android Studio,I'm stuck at a code due to this issue,also I'm a beginner to android and I do not have Experience,but am eager to learn,So please, Experts come and help me resolve the Issue.It will be so kind of Y'all.
I tried to resolve it,I added the Import by myself but the compose started to create Issues,I thought I'll be able to do it,still trying,but I need help here.
Upvotes: -2
Views: 72
Reputation: 254
Add dependency in your build.gradle and sync the Gradle.
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.4")
Edited answer.
If this will not help you, refer to ViewModel Overview once regarding Implement a ViewModel
topic.
Upvotes: 0