In which task and step of the codelab can this issue be found? Step 8, in the sample code to add JsonConverterFactory.
Describe the problem
You converting to mediatype by using the toMediaType() String extension. But the toMediaType() string extension is introduced in OkHttp4 and your retrofit is still depending on OkHttp3 which cause missing string extension toMediaType(). You need to call MediaType.get("application/json") instead of using the extension method
Steps to reproduce?
Follow the Codelab until step 8
Follow the codelab step 8 until task: Update MarsApiService and MarsViewModel
Follow the task until task step number 4
Implement according to the sample code
VersionsAndroid Studio version: 2021.3.1 Patch 1
API version of the emulator: N/A
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? Step 8, in the sample code to add JsonConverterFactory.
Describe the problem You converting to mediatype by using the toMediaType() String extension. But the toMediaType() string extension is introduced in OkHttp4 and your retrofit is still depending on OkHttp3 which cause missing string extension toMediaType(). You need to call MediaType.get("application/json") instead of using the extension method
Steps to reproduce?
Versions Android Studio version: 2021.3.1 Patch 1 API version of the emulator: N/A
Additional information