Skip to content

Build error with kotlinx serialization version #224

@meonlineoct2014

Description

@meonlineoct2014

URL of codelab:
https://github.com/google-developer-training/basic-android-kotlin-compose-training-mars-photos.git

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

English

In which task and step of the codelab can this issue be found?

Task name where the issue is : Add kotlinx.serialization library dependencies
Section name/number: **Section 8, Parse the JSON response with kotlinx.serialization

Describe the problem

The codelab instructions says to add kotlinx.serialization library dependencies with below
Open build.gradle.kts (Module :app).
In the plugins block, add kotlinx serialization plugin.

id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10"
But if we use version 1.8.10 the app crashes with below error
java.lang.IllegalArgumentException: Unable to create converter for java.util.List<com.example.marsphotos.network.MarsPhotos>
for method MarsApiService.getPhotos
To fix the issue, we have to use version "1.9.20"

Steps to reproduce?

  1. Go to... Logcat
  2. Click on... filter the logs for your app with package:mine
  3. See error...

Versions
Android Studio version:
API version of the emulator:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions