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 #152

Open Jorgeribmar opened 1 month ago

Jorgeribmar commented 1 month ago

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

Specify the language of the codelab if it is not English: french

In which task and step of the codelab can this issue be found? add plugin kotlinx serialization

Describe the problem exception java.lang.IllegalArgumentException: Unable to create converter when using plugin id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10"

updated it to kotlin("plugin.serialization") version "1.9.22" and it's working

Steps to reproduce?

  1. Go to step 8 add plugin to serialize Json
  2. follow the steps till end of file
  3. See error java.lang.IllegalArgumentException: Unable to create converter

Versions Android Studio version: Android Studio Jellyfish | 2023.3.1 API version of the emulator: On my device MIUI 14.0.9(TKFEUXM) - Android 13 TKQ1.221013.002

Additional information Include screenshots if they would be useful in clarifying the problem.

NitroXen commented 3 weeks ago

use this : implementation("com.squareup.retrofit2:converter-gson:2.10.0")

and for retrofit use this: .addConverterFactory(GsonConverterFactory.create())

the suggested library is DEPRECATED