문의 시, 사용하시는 SDK 버전 정보와 디벨로퍼스 앱ID를 알려주세요.
Faq 목록 - 10. Android ( Faq 목록 입니다 ) 먼저 확인해주세요.
안녕하세요.
Android 앱에서 Kakao SDK를 사용하고 있는데, 최근 배포 버전에서 이전에는 발생하지 않았던 아래 예외가 발생하고 있어 문의드립니다.
1. 개발 환경
- Platform: Android
- minSdkVersion: 29 (Android 10)
- Target SDK: Android 35
- Android Gradle Plugin: 8.3.2
- Kotlin: 1.8.10
- JDK: 17
- Kakao SDK for Android: implementation(“com.kakao.sdk:v2-share:2.20.0”)
- OkHttp: implementation ‘com.squareup.okhttp3:okhttp:4.12.0’
implementation ‘com.squareup.okhttp3:logging-interceptor:4.12.0’ - Retrofit: implementation ‘com.squareup.retrofit2:retrofit:2.4.0’
2. 발생 Exception
아래와 같은 Exception이 발생하고 있습니다.
Fatal Exception: java.lang.IllegalStateException: state: 0
at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:173)
at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:110)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at com.kakao.sdk.network.AppKeyInterceptor.intercept(AppKeyInterceptor.kt:33)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at com.kakao.sdk.network.KakaoAgentInterceptor.intercept(KakaoAgentInterceptor.kt:36)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1100)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:1572)
3. 확인한 내용
Stack Trace를 보면 다음과 같이 Kakao SDK의 네트워크 interceptor가 포함되어 있습니다.
com.kakao.sdk.network.AppKeyInterceptor
com.kakao.sdk.network.KakaoAgentInterceptor
그 과정에서 OkHttp의
okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders()
에서
IllegalStateException: state: 0
이 발생하고 있습니다.
또한 Stack Trace에
okhttp3.logging.HttpLoggingInterceptor
가 포함되어 있으나, 저희 애플리케이션 소스 코드에서는 HttpLoggingInterceptor를 직접 사용하고 있지 않습니다.
이 부분에 대해서 해결에 도움이 될만한 정보등이 있으시면 알려주시면 감사하겠습니다.