Closed koraysels closed 1 year ago
damn! i found the solution..
interface MarsApiService {
@GET("photos")
suspend fun getPhotos() : String
}
forgot to make the function suspendable
I would suggest re-opening this issue (to get it fixed) as I was going to report the issue. The codelab does not specify the suspend keyword and the error message is misleading.
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#6
In which task and step of the codelab can this issue be found? 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#6
Describe the problem It says the app should run and display the JSON content but it does not.
teh stacktrace of the crash indicates it cannot convert the returned JSON into a String object..
Versions _Android Studio version:_2022.2.1 Patch 1 API version of the emulator: 33
Additional information Include screenshots if they would be useful in clarifying the problem.