retrofit: FATAL EXCEPTION: OkHttp Dispatcher with okhttp:3.0.0
My setup without the problem:
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
My setup wit the problem and no code changes:
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
compile 'com.squareup.okhttp3:okhttp:3.0.0'
Produces following error:
FATAL EXCEPTION: OkHttp Dispatcher
Process: com.my.app, PID: 31176
java.lang.AbstractMethodError: abstract method "void okhttp3.Callback.onResponse(okhttp3.Call, okhttp3.Response)"
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:133)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:33)
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:818)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 34 (2 by maintainers)
😠If you are using logging interceptor you also need to properly version that:
If you are using LoganSquare you also need:
@sudhirkhanger you need change library with latest release stable version:
retrofit:2.0.2 - default used okhttp-3.2.0 and OkHttpClient class exists in retrofit:2.0.2’ library. If you need add logger to requests then you can simply add:
And all process will be works fine.
You need to use either:
You could subscribe this page to get latest lib update. https://bintray.com/bintray/jcenter/com.squareup.retrofit2%3Aretrofit/view
@sudhirkhanger AFAK Android Studio only tells you about its official libraries (Android Support Libraries, Android Gradle plugin etc), and obviously Retrofit is (currently) not.