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.

NoSuchMethodError: No virtual method log(Ljava/lang/String;)V in class Lokhttp3/internal/Platform;

See original GitHub issue

it’s fine if I delete

HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); logging.setLevel(HttpLoggingInterceptor.Level.BASIC); builder.interceptors().add(logging);

but if i use okhttp3 logging-interceptor, throw this exception:

java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread. at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:833) Caused by: java.lang.NoSuchMethodError: No virtual method log(Ljava/lang/String;)V in class Lokhttp3/internal/Platform; or its super classes (declaration of 'okhttp3.internal.Platform' appears in /data/app/com.ouyangzn.topgithub-2/base.apk) at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:109) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:157) at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:190) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:163) at okhttp3.RealCall.execute(RealCall.java:57) at retrofit2.OkHttpCall.execute(OkHttpCall.java:174) at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171) at rx.internal.operators.OperatorSubscribeOn$1$1$1$1.call(OperatorSubscribeOn.java:85) at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222) at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)  at java.util.concurrent.FutureTask.run(FutureTask.java:237)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)  at java.lang.Thread.run(Thread.java:833) 

Issue Analytics

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

github_iconTop GitHub Comments

39reactions
swankjessecommented, Sep 6, 2016

You need to use the same version for all of your OK dependencies. If you don’t, things won’t work!

4reactions
JakeWhartoncommented, Sep 7, 2016

Do not downgrade Retrofit. Upgrade OkHttp.

On Wed, Sep 7, 2016, 1:52 AM ouyangzn notifications@github.com wrote:

I used the same version: compile “com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}” compile “com.squareup.okhttp3:logging-interceptor:${OKHTTP_VERSION}” OKHTTP_VERSION = 3.2.0

Now i kown, the problem is caused by retrofit, i used : compile “com.squareup.retrofit2:retrofit:${RETROFIT_VERSION}” RETROFIT_VERSION = 2.1.0

retrofit 2.1.0 used okhttp3.3.0, so …

I convert retrofit version to 2.0.2, it’s ok.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/square/okhttp/issues/2839#issuecomment-245182274, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEET1RrHgJuRQa9Lk_Fy5tuLHPXdYyks5qnlE1gaJpZM4J1luG .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting java.lang.NoSuchMethodError, No virtual method log ...
NoSuchMethodError : No virtual method log(ILjava/lang/String;Ljava/lang/Throwable; V in class Lokhttp3/internal/platform/Platform;.
Read more >
java.lang.NoSuchMethodError No virtual method log(ILjava ...
NoSuchMethodError : No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)V in class Lokhttp3/internal/platform/Platform; or its ...
Read more >
移动应用程序监视常见问题及解答 - IBM
NoSuchMethodError : No virtual method log(Ljava/lang/String;)V in class Lokhttp3/internal/Platform; 运行时错误是什么意思? android.os.
Read more >
No virtual method getCamera() - Xamarin.AndroidX.Camera
Camera packages to the latest versions(1.0.2.1), and getting the below error. I need to set the custom ISO, custom exposure and white balance....
Read more >
Retrofit-java.lang.NoSuchMethodError: No virtual method log
NoSuchMethodError : No virtual method log(Ljava/lang/String;)V in class Lokhttp3/internal/Platform; or its super classes (declaration of 'okhttp3.internal.
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