AbstractMethodError for `onResponse(...)` #2245

Closed
ahuang13 opened this Issue Jan 14, 2016 · 2 comments

Comments

3 participants
@ahuang13

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'
@JakeWharton

This comment has been minimized.

Show comment
Hide comment
@JakeWharton

JakeWharton Jan 14, 2016

Collaborator

Retrofit 2b3 doesn't work with OkHttp 3 final. You'll need to use Retrofit 2.0.0-SNAPSHOT until the next Retrofit release.

Collaborator

JakeWharton commented Jan 14, 2016

Retrofit 2b3 doesn't work with OkHttp 3 final. You'll need to use Retrofit 2.0.0-SNAPSHOT until the next Retrofit release.

@silentsudo

This comment has been minimized.

Show comment
Hide comment
@silentsudo

silentsudo Jan 29, 2016

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment