작성
·
27
0
개발자님 혹시 제가 android 2024.2.2 버전을 사용하고 있는데 이 버전에서는 dependencies부분에 retrofit2을 어떻게 추가해야하는지 알 수 있을까요?
아래와 같이 두 방법으로 시도해봤는데 추가가 안되는 거 같아 질문드립니다.
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
implementation(libs.retrofit)
implementation(libs.converter.gson)
답변 2
0
0
myApi 파일에 import가 잘못되었네요
package com.example.retrofit_ex1
import retrofit2.Call
import retrofit2.http.GET
interface MyApi {
@GET("posts/1")
fun getPost1() : Call<Post>
}
이렇게 변경해보시겠어요?
기존에는
package com.example.retrofit_ex1
import android.telecom.Call
import retrofit2.http.GET
interface MyApi {
@GET("posts/1")
fun getPost1() : Call<Post>
}
이렇게 되어있었습니다.
https://github.com/SuHwanYY/retrofit_ex
여기 있습니다!