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 #141

Closed xhbear closed 8 months ago

xhbear 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? step 7. Below the call to the Retrofit builder, define an interface called MarsApiService, that defines how Retrofit talks to the web server using HTTP requests.

interface MarsApiService {
}

Describe the problem The instruction is to write an interface with a conflicting name as to the kotlin file it is in. (interface and kotlin class share the same name). This causes Android Studio to report an error message: "Redeclaration: MarsApiService".

Steps to reproduce?

  1. Go to... com/example/android/marsphotos/network/MarsApiService.kt
  2. Follow step 7 and write down the interface code
    interface MarsApiService {
    }
  3. See error... Redeclaration: MarsApiService

Versions Android Studio version: version 11 API version of the emulator: NA

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

Screenshot 2022-07-03 at 5 37 16 PM