question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Square recently released OkHttp 4. It’s a Kotlin porting of OkHttp 3 with some minor changes and will be the basis of all the subsequent Square releases, so it’s important to upgrade gander, as it currently crashes when used in an app with OkHttp 4. I can help with a PR but I preferred to write here first to let you know and have your feedback about it.

This is the stack trace:

java.lang.NoSuchMethodError: No static method hasBody(Lokhttp3/Response;)Z in class Lokhttp3/internal/http/HttpHeaders; or its super classes
        at com.ashokvarma.gander.GanderInterceptor.updateTransactionFromResponse(GanderInterceptor.java:250)
        at com.ashokvarma.gander.GanderInterceptor.intercept(GanderInterceptor.java:161)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)

And this is the official thread: https://github.com/square/okhttp/issues/5246 in which square devs advises to not rely on that method, but to copy and paste this one: https://github.com/square/okhttp/blob/eee838aebe8d3524d7e0e2dbf8f9bf357512f038/okhttp/src/main/java/okhttp3/internal/http/HttpHeaders.kt#L213

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
gotevcommented, Jul 7, 2019

@Ashok-Varma made a check and it appears it was the only OkHttp internal method used 😉

Just as advice, to ease other developers contributions consider adding CONTRIBUTING.md and CODE_OF_CONDUCT.md to your repo. This can be useful as an example: https://gist.github.com/PurpleBooth/b24679402957c63ec426

0reactions
gotevcommented, Jul 15, 2019

Fantastic!!

Read more comments on GitHub >

github_iconTop 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 everything else the same. We've chosen Kotlin because it gives us...
Read more >
OkHttp 4 Goes Kotlin - Cash App Code Blog
OkHttp is an HTTP client for Java and Android. Until today the library itself was all Java. With version 4 we've switched to...
Read more >
A Guide to OkHttp - Baeldung
In this tutorial, we'll explore the basics of sending different types of HTTP requests, and receiving and interpreting HTTP responses.
Read more >
com.squareup.okhttp3 » okhttp » 4.0.0-alpha01
OkHttp » 4.0.0-alpha01. Square's meticulous HTTP client for Java and Kotlin. License, Apache 2.0.
Read more >
A complete guide to OkHttp - LogRocket Blog
The stable OkHttp 4.x works on Android 5.0+ (API level 21+) and Java 8+. If you require lower Android and Java version support, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found