google-developer-training / basic-android-kotlin-compose-training-mars-photos

Solution code for Android Basics in Kotlin course
https://developer.android.com/courses/android-basics-kotlin/course?gclid=CjwKCAjw4c-ZBhAEEiwAZ105RTyT-iaLHzrhMBUXdMhO230ZDwOwxxI2x4RgK8DwBxK8t1h0wmU_QxoCi4YQAvD_BwE
Apache License 2.0
66 stars 54 forks source link

Get Data from the Internet - Serialization plugin 1.8.10 not working as expected #134

Open fabiocarluccio opened 3 months ago

fabiocarluccio commented 3 months ago

URL of codelab: https://developer.android.com/codelabs/basic-android-kotlin-compose-getting-data-internet?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-5-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-getting-data-internet#7

In which task and step of the codelab can this issue be found? On the section "Add kotlinx.serialization library dependencies"

Describe the problem I've followed the tutorial, but I get a runtime exception when running the app using the kotlin serialization plugin 1.8.10.

I found that on the solution code proposed on github for this codelab, that the version used is not the 1.8.10, but instead the 1.9.10. By using this new version of the plugin, I get no error, and the app works as expected.

Proposed solution Change this line id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10" into this line id("org.jetbrains.kotlin.plugin.serialization") version "1.9.10"

TonyGnk commented 3 months ago

Same error here

tinasche commented 3 months ago

Got the same error. I ended up replacing the kotlin serialization plugin with the implementation from retrofit for gson converter factory in this reference: implementation("com.squareup.retrofit2:converter-gson:2.6.4"). Seems to work just as well