okhttp icon indicating copy to clipboard operation
okhttp copied to clipboard

java.lang.ExceptionInInitializerError - Occurs only for Android 11

Open AIRongbin1990 opened this issue 3 years ago • 3 comments

Environment

Android Studio version: 4.1.2
defaultConfig {
     minSdkVersion 21
    targetSdkVersion 29
}
Android platform: Android 11
Deivce: Most Samsung models, Pixel3,4,5, OnePlus 8 Pro
detail sdk version:
api 'com.squareup.okhttp3:logging-interceptor:4.9.0'
api 'com.squareup.okhttp3:okhttp:4.9.0' 

api 'com.squareup.retrofit2:retrofit:2.9.0'
api 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
api 'com.squareup.retrofit2:converter-gson:2.9.0'

api 'io.reactivex.rxjava2:rxandroid:2.1.1'
api 'io.reactivex.rxjava2:rxjava:2.2.12'

api 'com.google.firebase:firebase-messaging:21.0.0'

Describe

App crashes on load for Android 11.

Log from google play console

io.reactivex.exceptions.UndeliverableException: at io.reactivex.plugins.RxJavaPlugins.onError (RxJavaPlugins.java:367) at io.reactivex.internal.schedulers.ScheduledRunnable.run (ScheduledRunnable.java:69) at io.reactivex.internal.schedulers.ScheduledRunnable.call (ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run (FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) Caused by: java.lang.ExceptionInInitializerError: at okhttp3.internal.http2.Hpack$Writer.writeByteString (Hpack.java:568) at okhttp3.internal.http2.Hpack$Writer.writeHeaders (Hpack.java:532) at okhttp3.internal.http2.Http2Writer.goAway (Http2Writer.java:296) at okhttp3.internal.http2.Http2Writer.frameHeader (Http2Writer.java:296) at okhttp3.internal.http2.Http2Writer.headers (Http2Writer.java:296) at okhttp3.internal.http2.Http2Connection.newStream (Http2Connection.java:259) at okhttp3.internal.http2.Http2Connection.newStream (Http2Connection.java:225) at okhttp3.internal.http2.Http2ExchangeCodec.writeRequestHeaders (Http2ExchangeCodec.java:76) at okhttp3.internal.connection.Exchange.writeRequestHeaders (Exchange.java:59) at okhttp3.internal.http.CallServerInterceptor.intercept (CallServerInterceptor.java:36) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.connection.ConnectInterceptor.intercept (ConnectInterceptor.java:34) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.java:95) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.java:83) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.java:76) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.connection.RealCall.k (RealCall.java:201) at okhttp3.internal.connection.RealCall.execute (RealCall.java:154) at retrofit2.OkHttpCall.execute (OkHttpCall.java:204) at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual (CallExecuteObservable.java:46) at io.reactivex.Observable.subscribe (Observable.java:12267) at io.reactivex.internal.operators.flowable.FlowableFromObservable.subscribeActual (FlowableFromObservable.java:29) at io.reactivex.Flowable.subscribe (Flowable.java:14918) at io.reactivex.internal.operators.flowable.FlowableOnBackpressureLatest.subscribeActual (FlowableOnBackpressureLatest.java:32) at io.reactivex.Flowable.subscribe (Flowable.java:14918) at io.reactivex.Flowable.subscribe (Flowable.java:14865) at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run (FlowableSubscribeOn.java:82) at io.reactivex.internal.schedulers.ScheduledRunnable.run (ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call (ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run (FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) Caused by: java.lang.NullPointerException: at okhttp3.internal.http2.Huffman.addCode (Huffman.java:166) at okhttp3.internal.http2.Huffman. (Huffman.java:82) at okhttp3.internal.http2.Hpack$Writer.writeByteString (Hpack.java:568) at okhttp3.internal.http2.Hpack$Writer.writeHeaders (Hpack.java:532) at okhttp3.internal.http2.Http2Writer.goAway (Http2Writer.java:296) at okhttp3.internal.http2.Http2Writer.frameHeader (Http2Writer.java:296) at okhttp3.internal.http2.Http2Writer.headers (Http2Writer.java:296) at okhttp3.internal.http2.Http2Connection.newStream (Http2Connection.java:259) at okhttp3.internal.http2.Http2Connection.newStream (Http2Connection.java:225) at okhttp3.internal.http2.Http2ExchangeCodec.writeRequestHeaders (Http2ExchangeCodec.java:76) at okhttp3.internal.connection.Exchange.writeRequestHeaders (Exchange.java:59) at okhttp3.internal.http.CallServerInterceptor.intercept (CallServerInterceptor.java:36) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.connection.ConnectInterceptor.intercept (ConnectInterceptor.java:34) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.java:95) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.java:83) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.java:76) at okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:109) at okhttp3.internal.connection.RealCall.k (RealCall.java:201) at okhttp3.internal.connection.RealCall.execute (RealCall.java:154) at retrofit2.OkHttpCall.execute (OkHttpCall.java:204) at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual (CallExecuteObservable.java:46) at io.reactivex.Observable.subscribe (Observable.java:12267) at io.reactivex.internal.operators.flowable.FlowableFromObservable.subscribeActual (FlowableFromObservable.java:29) at io.reactivex.Flowable.subscribe (Flowable.java:14918) at io.reactivex.internal.operators.flowable.FlowableOnBackpressureLatest.subscribeActual (FlowableOnBackpressureLatest.java:32) at io.reactivex.Flowable.subscribe (Flowable.java:14918) at io.reactivex.Flowable.subscribe (Flowable.java:14865) at io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run (FlowableSubscribeOn.java:82) at io.reactivex.internal.schedulers.ScheduledRunnable.run (ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call (ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run (FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923)

Please help me clean this issue. thanks

AIRongbin1990 avatar Apr 17 '21 15:04 AIRongbin1990

+1

firelotus avatar May 31 '21 03:05 firelotus

any update with the issue?

pissumos avatar Nov 15 '21 09:11 pissumos

Not sure where to start on this. It looks like either a VM bug or something else interfering. Are you using R8 or Proguard or something like that?

If you'd like to submit a test case to isolate/reproduce this, that's the next step. I think that means changing our Android test suite to run on Android 11 in a way that reprodces this.

swankjesse avatar Dec 01 '21 12:12 swankjesse

Closing as not reproducible.

yschimke avatar May 21 '23 09:05 yschimke