Open dylantrepos opened 6 months ago
With my current version of Kotlin, I don't have build.gradle file but build.gradle.kts so in order to add thoses imports, i had to do :
1. Add the following variable to your project build.gradle file:
buildscript { extra.apply { set("lifecycle_version", "2.5.1") } }
2. Add the following dependency to the app/build.gradle file:
dependencies { val lifecycle_version = rootProject.extra["lifecycle_version"] ... implementation("androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle_version") ... }
Not sure if it's the best way to do because I'm a newbie in Android, but at least it works for me, so it may works for others. Thank you !
With my current version of Kotlin, I don't have build.gradle file but build.gradle.kts so in order to add thoses imports, i had to do :
1. Add the following variable to your project build.gradle file:
buildscript { extra.apply { set("lifecycle_version", "2.5.1") } }
2. Add the following dependency to the app/build.gradle file:
dependencies { val lifecycle_version = rootProject.extra["lifecycle_version"] ... implementation("androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle_version") ... }
Not sure if it's the best way to do because I'm a newbie in Android, but at least it works for me, so it may works for others. Thank you !