google-developer-training / android-basics-kotlin-mars-photos-app

Apache License 2.0
91 stars 193 forks source link

Android Basics: Get data from the Internet #155

Closed Usman3900 closed 8 months ago

Usman3900 commented 2 years ago

name: Android Basics Unit 4 issue about: Report problems with the Android Basics Unit 4 codelabs title: 'Android Basics Unit 4 issue:' labels: '' assignees: ''


URL of codelab https://developer.android.com/codelabs/basic-android-kotlin-training-getting-data-internet?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-4-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-getting-data-internet#5

In which task and step of the codelab can this issue be found? Connection to the internet.

Describe the problem We need to add internet permissions to avoid the app crash but even after adding permission app still crashes.

Error followed is : java.lang.IllegalArgumentException: Unable to create call adapter for class java.lang.String for method MarsApiService.getPhotos

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions Android Studio version: ChipMunk | 2021.2.1 Patch 1 API version of the emulator: API 30

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

Problem can be resolved by making the getPhotos() function suspend