retrofit icon indicating copy to clipboard operation
retrofit copied to clipboard

FATAL EXCEPTION: OkHttp Dispatcher - java.lang.NoSuchMethodError: okhttp3.internal.Platform.log

Open ThameemAK opened this issue 10 years ago • 1 comments

Gradle:

compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3' compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3' compile 'com.squareup.okhttp3:logging-interceptor:3.0.0-RC1'

compile('com.paypal.sdk:paypal-android-sdk:2.14.4'){ exclude group: 'io.card' }

Issue:

I used Retrofit for API calling. Now i have to integrate Paypal in my App. When i using the above combination of gradle, am getting this error

08-31 18:21:09.134 29340-29363/com.zalabya E/AndroidRuntime﹕ FATAL EXCEPTION: OkHttp Dispatcher Process: com.zalabya, PID: 29340 java.lang.NoSuchMethodError: okhttp3.internal.Platform.log at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:108) 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.access$100(RealCall.java:30) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:127) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841)

ThameemAK avatar Aug 31 '16 12:08 ThameemAK

This is a problem with your build configuration, not Retrofit. If you run ./gradlew dependencies you'll see that the version of 'okhttp' is different than the version of 'logging-interceptor'. Ensure that they're both the same by explicitly specifying both dependencies with modern versions (the latest is 3.4.0) so that you don't get missing method errors like this.

JakeWharton avatar Aug 31 '16 13:08 JakeWharton