Dev/Error

Android - E/AndroidRuntime: FATAL EXCEPTION: grpc-okhttp-0

healthyryu 2022. 2. 11. 11:39

안드로이드에서 라이브러리 최신으로 올리면서 발생한 이슈

여러개의 라이브러리 버전을 업하다보니 정확히 무엇때문에 발생했는지 찾기에는 시간이 걸려서 패스

 

일단은 원인은 아래와 같다고 나왔기 때문에 해당 부분에 대해서 조치를 했다

 

이슈

2022-02-11 11:24:07.381 6651-6740/com.healthyryu.test.debug E/AndroidRuntime: FATAL EXCEPTION: grpc-okhttp-0
    Process: com.healthyryu.test.debug, PID: 6651
    java.lang.AssertionError: Method getAlpnSelectedProtocol not supported for object SSL socket over Socket[address=firebaseinappmessaging.googleapis.com/142.251.42.138,port=443,localPort=42264]
        at io.grpc.okhttp.internal.OptionalMethod.invoke(OptionalMethod.java:114)
        at io.grpc.okhttp.internal.OptionalMethod.invokeWithoutCheckedException(OptionalMethod.java:135)
        at io.grpc.okhttp.OkHttpProtocolNegotiator$AndroidNegotiator.getSelectedProtocol(OkHttpProtocolNegotiator.java:183)
        at io.grpc.okhttp.OkHttpProtocolNegotiator$AndroidNegotiator.negotiate(OkHttpProtocolNegotiator.java:145)
        at io.grpc.okhttp.OkHttpTlsUpgrader.upgrade(OkHttpTlsUpgrader.java:63)
        at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:571)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)

 

해결 방법

implementation("com.google.firebase:firebase-inappmessaging-display-ktx") {
    exclude(group = "io.grpc", module = "grpc-okhttp")
}
implementation("io.grpc:grpc-okhttp:1.41.0")

참고 : https://stackoverflow.com/questions/66939341/okhttp-exception-java-lang-assertionerror-on-android-11-sdk-30

 

Okhttp exception java.lang.AssertionError on Android 11 sdk 30

I use com.squareup.okhttp3:okhttp:4.4.1 but when should the messages from firebase in app messaging be displayed (when the app starts) the app crashes on 11 android. Okhttp in mainactivity I don't ...

stackoverflow.com

 

반응형