안드로이드 Kakao sdk

SDK 2.9.1
사용 중에 있습니다.

저희가 사용하는 라이브러리 상에서 GSON, OKHTTP, RETROFIT 모두 필수 사용중으로 implementaition 되어있는데…
implementation (“com.kakao.sdk:v2-user:2.9.1”) 할 경우에

  • Duplicate class found 이렇게 에러 로그가 출력되어서요…
    어떻게 해야할 수 있을까요?.

안녕하세요

사용 중인 gson, okhttp, retrofit 버전 정보와 에러 로그 전문 첨부 부탁드립니다.

현재 코드는
implementation(“com.kakao.sdk:v2-user:2.9.1”) {
configurations {
exclude module: ‘okhttp’
exclude module: ‘gson’
exclude module: ‘retrofit’
}
}

사용하고있는 버전 정보는
gson - 2.8.1
okhttp 3.10.0
retrofit 2.4.0

Duplicate class retrofit2.converter.gson.GsonConverterFactory found in modules jetified-converter-gson-2.6.2 (com.squareup.retrofit2:converter-gson:2.6.2) and jetified-d30_lite-runtime (a.aar)
Duplicate class retrofit2.converter.gson.GsonRequestBodyConverter found in modules jetified-converter-gson-2.6.2 (com.squareup.retrofit2:converter-gson:2.6.2) and jetified-d30_lite-runtime (a.aar)
Duplicate class retrofit2.converter.gson.GsonResponseBodyConverter found in modules jetified-converter-gson-2.6.2 (com.squareup.retrofit2:converter-gson:2.6.2) and jetified-d30_lite-runtime (a.aar)
Duplicate class retrofit2.converter.gson.package-info found in modules jetified-converter-gson-2.6.2 (com.squareup.retrofit2:converter-gson:2.6.2) and jetified-d30_lite-runtime (a.aar)

말씀해주신 버전 의존성 추가해서 재현 시도했을 때는 재현이 안되네요

아래와 같이 수정해보시겠어요?

implementation("com.kakao.sdk:v2-user:2.9.1") {
        exclude group: "com.squareup.okhttp3", module: 'okhttp'
        exclude group: "com.squareup.retrofit2", module: 'converter-gson'
        exclude group: "com.squareup.retrofit2", module: 'retrofit'
        exclude group: "com.google.code.gson", module: 'gson'
}

해당 부분은 해결되었습니다만…
혹시 okhttp 에서의 interceptor 는 어떻게해야 추가가 가능할까요…?
→ com.squareup.okhttp3:logging-interceptor:3.9.0
이부분입니다.
혹시 사용중이라면 exclude 어찌해야하나요?

별도로 implementation com.squareup.okhttp3:logging-interceptor:3.9.0 로 추가하셔도 이슈없을 것으로 보이는데요, 추가했을 때 에러가 발생한다면 아래와 같이 수정 부탁드립니다.

implementation("com.kakao.sdk:v2-user:2.9.1") {
        exclude group: "com.squareup.okhttp3", module: 'okhttp'
        exclude group: "com.squareup.retrofit2", module: 'converter-gson'
        exclude group: "com.squareup.retrofit2", module: 'retrofit'
        exclude group: "com.google.code.gson", module: 'gson'
        exclude group: "com.squareup.okhttp3", module: 'logging-inerceptor'
}

추가로 처음에 첨부해주신 에러 로그를 봤을 때 converter-gson 쪽에서 충돌이 일어나는 것으로 보여서 에러가 발생하지 않는 부분 exclude는 제거해주시길 권장드립니다.

1개의 좋아요