Android AGP 4.0, R8 - Http2Writer NPE Okhttp v4.3.0
See original GitHub issueSeeing the following crashes on Android with Okhttp v4.3.0, not happening on v4.2.2
- Using http2 rest endpoints with retrofit and rxjava.
Fatal Exception: m0.a
at okio.Buffer.writableSegment$okio(Buffer.java:1812)
at okio.Buffer.writeByte(Buffer.java:1662)
at okio.RealBufferedSink.writeByte(RealBufferedSink.java:197)
at okhttp3.internal.Util.writeMedium(Util.java:309)
at okhttp3.internal.http2.Http2Writer.frameHeader(Http2Writer.java:261)
at okhttp3.internal.http2.Http2Writer.settings(Http2Writer.java:173)
at okhttp3.internal.http2.Http2Connection.start(Http2Connection.java:496)
at okhttp3.internal.http2.Http2Connection.start$default(Http2Connection.java:493)
at okhttp3.internal.connection.RealConnection.startHttp2(RealConnection.java:329)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:312)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:182)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:238)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:111)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:79)
at okhttp3.internal.connection.Transmitter.newExchange$okhttp(Transmitter.java:163)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:35)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:112)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:87)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:82)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:112)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:87)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:84)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:112)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:71)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:112)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:87)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:194)
at okhttp3.RealCall$AsyncCall.run(RealCall.java:138)
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:919)
and
Fatal Exception: m0.a
at okio.Segment.pop(Segment.java:89)
at okio.Buffer.skip(Buffer.java:1478)
at okio.RealBufferedSource.skip(RealBufferedSource.java:431)
at okhttp3.internal.http2.Http2Connection$ReaderRunnable.data(Http2Connection.java:643)
at okhttp3.internal.http2.Http2Reader.readData(Http2Reader.java:178)
at okhttp3.internal.http2.Http2Reader.nextFrame(Http2Reader.java:117)
at okhttp3.internal.http2.Http2Connection$ReaderRunnable.run(Http2Connection.java:614)
at java.lang.Thread.run(Thread.java:919)
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Upgrading to OkHttp 4 - Square Open Source
OkHttp 4.x upgrades our implementation language from Java to Kotlin and keeps ... to upgrade Java uses of OkHttp 3.x to 4.x without...
Read more >Past releases - Android Developers
This page lists the new features and improvements for each major release of past Android Studio and Android Gradle plugin releases. To see...
Read more >Error while dexing with okhttp 4.0.0 releases [135141615]
Happens every time we try to run the app. Reverting to okhttp version 3.14.2 fixes it. Also, tried with all the latest Android...
Read more >Android Studio 4.0 Beta 1 available
General fixes · Android Gradle Plugin. Issue #144513656: Lint's Gradle task hangs after update to AGP 3.6. · Android Studio. Issue #71894463: ...
Read more >android - not able to import com.squareup.okhttp.OkHttpClient
Gradle should have a line like this implementation 'com.squareup.okhttp3:okhttp:3.0.1'. and this is how you import it import okhttp3.OkHttpClient;.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Make you sure you put a big
# TODO Remove once R8 fixes <issue link>
so that rule doesn’t stay in your rules forever!Are you using AGP 4.0.0 with R8? I’ve had similar exceptions with that combination.
I’ve opened an issue on the R8 issue tracker, which also includes a project where you can reproduce the issue: https://issuetracker.google.com/issues/147411673