okhttp
okhttp copied to clipboard
AbstractMethodError for `onResponse(...)`
Any idea what could be causing the following exception after making a Call?
FATAL EXCEPTION: OkHttp Dispatcher
Process: com.coulombtech.dev, PID: 4547
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:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
I have the following defined in my build.gradle...
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'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.0'
compile 'com.squareup.okio:okio:1.6.0'
Retrofit 2b3 doesn't work with OkHttp 3 final. You'll need to use Retrofit 2.0.0-SNAPSHOT until the next Retrofit release.
My dependency is like this and i am still getting this error
compile 'com.google.code.gson:gson:2.4'
// compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:retrofit:2.0.0-SNAPSHOT'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
Error is still there even i tried this
`compile 'com.google.code.gson:gson:2.4'
// compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:retrofit:2.0.0-SNAPSHOT'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
compile 'com.squareup.okhttp3:okhttp:2.0.0-SNAPSHOT'`
God solved by
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.0-RC1'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
@lepipele gave the solution