Hey! I worked today through the KMP starter guide,...
# multiplatform
m
Hey! I worked today through the KMP starter guide, really nice docs. THX for that! There is one issue in the docs, that took me a while figuring out. Maybe someone from the Jetbrains Team can fix it, so that future devs will not experience the issue? Tagging here @Anastasia Kaptsova (JetBrains) , since you have (Jetbrains) in your name😄 Issue Description: https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-upgrade-app.html#introduce-a-view-model In the 1) todo here, one should add the following dependencies:
Copy code
androidMain.dependencies {
    // ...
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
    implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.2")
    implementation(libs.androidx.lifecycle.viewmodel.compose)
}
The first two dependencies use legacy syntax while the third uses gradle version catalogs. When pasting the code in like this, the IDEs auto converting (via the tooltip) of the first two dependencies to version catalogs fails somehow. I had to first paste in the first two dependencies, let the IDE do its magic and then paste in the third -> followed by a Gradle Sync. This could probably be solved by either specifying all three dependencies in the docs via version catalogs, or none. Just an FYI, maybe it helps someone.
âž• 1
✅ 1
t
cc @Aleksey Zamulla
a
Yeah, that's an awkward combination, thanks for reporting it! I'll quickly fix this by changing the last dependency to the old syntax as well. We'll probably advise explicitly interacting with the the version catalog in the future.