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.

Exception in thread "OkHttp Dispatcher" java.lang.NoSuchMethodError: okio.BufferedSource.getBuffer()Lokio/Buffer;

See original GitHub issue

I use okhttpVersion = 3.14.1 and got the following error when I integrate with line bot library.

Exception in thread "OkHttp Dispatcher" java.lang.NoSuchMethodError: okio.BufferedSource.getBuffer()Lokio/Buffer;
	at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:252)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at com.linecorp.bot.client.HeaderInterceptor.intercept(HeaderInterceptor.java:39)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:172)
	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

The error because of can’t resolve method getBuffer() from BufferedSource object. I think it should be source.buffer() not source.getBuffer()

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
TangHuaiZhecommented, May 10, 2019

The versions of okhttp, okio, and HttpLoggingInterceptor need to be same.

2reactions
TangHuaiZhecommented, May 10, 2019

Try the same ok version as in the line library

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception in thread Okhttp Dispatcher - java
I solved this issue, it was a problem with version. Here is the version, I am using and worked. <dependency org="com.squareup.retrofit2" ...
Read more >
Directions API
Exception in thread "main" java.lang.NoSuchMethodError: okio.BufferedSource.rangeEquals(JLokio/ByteString;)Z at okhttp3.internal.Util.
Read more >
Okhttp关于java.lang.NoSuchMethodError: okio. ...
java.lang.NoSuchMethodError: okio.BufferedSource.readUtf8LineStrict(J)Ljava/lang/String; at okhttp3.internal.http1.Http1ExchangeCodec.
Read more >
问答- 腾讯云开发者社区-腾讯云
NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: okio.BufferedSource.rangeEquals(JLokio/ByteString;)Z
Read more >
Okhttp 行家, Okhttp3 行家, okhttp okio, 线程okhttp 调度程序 ...
java.lang.NoSuchMethodError: okio.BufferedSource.rangeEquals, java.lang.ClassCastException: java.lang.String 无法转换为java.util.Map #280。Open Xgamefactory 已 ...
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