Describe the problem
private val retrofit = Retrofit.Builder()
.addConverterFactory(Json.asConverterFactory("application/json".toMediaType()))
.baseUrl(BASE_URL)
.build()
The toMediaType() is not available.
Steps to reproduce?
Go to...
Click on...
See error...
VersionsAndroid Studio version:API version of the emulator:
Additional informationInclude screenshots if they would be useful in clarifying the problem.
private val retrofit = Retrofit.Builder()
.addConverterFactory(Json.asConverterFactory(MediaType.get("application/json")))
.baseUrl(BASE_URL)
.build()
MediaType.get() resolves the issue.toMediaType() Nothing can be solved.
URL of codelab:
Specify the language of the codelab if it is not English:
In which task and step of the codelab can this issue be found? 8. Parsing JSON response using kotlinx.serialization
Describe the problem private val retrofit = Retrofit.Builder() .addConverterFactory(Json.asConverterFactory("application/json".toMediaType())) .baseUrl(BASE_URL) .build()
The toMediaType() is not available.
Steps to reproduce?
Versions Android Studio version: API version of the emulator:
Additional information Include screenshots if they would be useful in clarifying the problem. private val retrofit = Retrofit.Builder() .addConverterFactory(Json.asConverterFactory(MediaType.get("application/json"))) .baseUrl(BASE_URL) .build()
MediaType.get() resolves the issue.toMediaType() Nothing can be solved.