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)
I have a same error:
FATAL EXCEPTION: OkHttp Dispatcher
Process: com.wahanda.connect.wahapp, PID: 11610
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)
Dependency :
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'
Initing retrofit :
HttpLoggingInterceptor logger = new HttpLoggingInterceptor();
logger.setLevel(HttpLoggingInterceptor.Level.BODY);
mHttpClient = new OkHttpClient.Builder().addInterceptor(logger).build();
mRetrofit = new Retrofit.Builder().baseUrl("http://example.com/api/")
.addConverterFactory(GsonConverterFactory.create())
.client(mHttpClient)
.build();
userHttpService = mRetrofit.create(UserHttpService.class);
Die to #1471, You should use RC1 ultill they release next snapshot of Retrofit.
@eneim this must be the reason.
Use the snapshot for now: compile 'com.squareup.retrofit2:retrofit:2.0.0-SNAPSHOT'
Neither compile 'com.squareup.retrofit2:retrofit:2.0.0-SNAPSHOT' nor com.squareup.okhttp3:okhttp:3.0.0-RC1 (all combinations -- separately and together, since I imagine 2.0.0-SNAPSHOT is compatible with 3.0.0 and 2.0.0-beta3 is expected to work with 3.0.0-RC1.
Anyone have a bright idea or should I just be patient?
@pabloogc right!, I using " compile 'com.squareup.retrofit:retrofit:2.0.0-beta2' " now and works fine.
This is working for me:
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
You need to use either:
Is it possible to publish a new beta/stable release with okhttp 3.0.1 rather than just using SNAPSHOT? Thanks. :)
;( If you are using logging interceptor you also need to properly version that:
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'
If you are using LoganSquare you also need:
apt 'com.bluelinelabs:logansquare-compiler:1.3.4'
compile 'com.bluelinelabs:logansquare:1.3.4'
compile 'com.github.aurae.retrofit2:converter-logansquare:1.2.
@lepipele that worked for me. Thanks!
Thanks @lepipele that is what worked for me too! :+1:
Thans @lepipele You saved me :beers:
@JakeWharton considering number of people that run into this issue, do you think that it would be worthwhile to add few lines on this topic to main README? At least until Retrofit starts working with newest OkHttp?
Thanks @lepipele .
+1
OkHttp 3.0.0-RC1 with Retrofit 2.0.0-beta3 Both of these configurations are confirmed to work.
This is work for me ,thanks !
If you are like me you had issues with Picasso and the OkHttp3Downloader....Rather than using the standalone downloader repo I used the Picasso 2.6.0 snapshot
https://oss.sonatype.org/content/repositories/snapshots/com/squareup/picasso/picasso/2.6.0-SNAPSHOT/
and using compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
Both of the recommended correct versions don't seem to work for me:
compile 'com.squareup.retrofit2:retrofit:2.0.0-SNAPSHOT'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
compile 'com.squareup.okhttp3:okhttp:3.0.1'
results in:
FATAL EXCEPTION: OkHttp Dispatcher
Process: com.craftrapps.realtour, PID: 20712
java.lang.AbstractMethodError: abstract method "void okhttp3.Callback.onFailure(okhttp3.Call, java.io.IOException)"
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:140)
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)
and
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'
results in:
FATAL EXCEPTION: OkHttp Dispatcher
Process: com.craftrapps.realtour, PID: 25069
java.lang.AbstractMethodError: abstract method "void okhttp3.Callback.onFailure(okhttp3.Call, java.io.IOException)"
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:140)
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)
Can anybody see what I am missing?
I have also tried:
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
compile 'com.squareup.retrofit2:retrofit:2.0.0-SNAPSHOT'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-SNAPSHOT'
compile 'com.squareup.retrofit2:retrofit-converters:2.0.0-SNAPSHOT'
}
I still get the same error.
I added
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
explicitly and it still did not work but then I removed all direct usages of OkHttp in my code and all imports of:
import okhttp3.ResponseBody;
and that seems to have fixed it.
@rick-kln retrofit 2 comes with okhttp so if you don't need anything in the additional dependency you would be fine.
I am running my project with retrofit 2.0 snapshot and no okhttp but I am still about to use OkhttpClient and other tools within the project.
I say this because I found that it is okhttp dependency that was causing the issue for me. Once removed, it all worked
Yeah, it was my explicit usages of Okhttp in the project that was the problem. I removed all the usages and that fixed it.
If you are using @JakeWharton 's Picasso OkHttp3 Downloader, you should also use version 1.0.1 not 1.0.2
06-11 07:43:26.809 11789-11872/com.sudhirkhanger.app.stockhawk E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.sudhirkhanger.app.stockhawk, PID: 11789
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:32)
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)
Should I still expect this error with following dependencies?
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
Probably. Stop using the beta versions of Retrofit.
On Fri, Jun 10, 2016, 10:16 PM Sudhir Khanger [email protected]
wrote:
06-11 07:43:26.809 11789-11872/com.sudhirkhanger.app.stockhawk E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.sudhirkhanger.app.stockhawk, PID: 11789
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:32)
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)Should I still expect this error with following dependencies?
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/square/retrofit/issues/1475#issuecomment-225331394,
or mute the thread
https://github.com/notifications/unsubscribe/AAEEEYTH7CXgOZVFc-2WQ9YkEhtoeD44ks5qKhp8gaJpZM4HEztd
.
@sudhirkhanger you need change library with latest release stable version:
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
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:
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0
And all process will be works fine.
Thanks @boyfox and @JakeWharton updating the dependencies solved it for me. I wonder why Android Studio doesn't tell me if I am using an older version.
@sudhirkhanger AFAK Android Studio only tells you about its official libraries (Android Support Libraries, Android Gradle plugin etc), and obviously Retrofit is (currently) not.
You could subscribe this page to get latest lib update.
https://bintray.com/bintray/jcenter/com.squareup.retrofit2%3Aretrofit/view
For retrofit ive found that if i remove the application name from the manifest file, OKHTTP wont work and crashes without any pointers as to what caused the problem.. try adding a name in the application tag in the manifest and give it a try..
Hi, I need help. I have the same error
I'm having same issue,
2020-05-29 11:42:47.046 16322-16534/com.example.wanderspacetraveljournalapp E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.example.wanderspacetraveljournalapp, PID: 16322
java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Platform;
at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:108)
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:157)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.internal.Platform" on path: DexPathList[[zip file "/data/app/com.example.wanderspacetraveljournalapp-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.wanderspacetraveljournalapp-1/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:108)Â
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:157)Â
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)Â
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)Â
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)Â
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)Â
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)Â
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)Â
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)Â
at java.lang.Thread.run(Thread.java:761)Â
and this things in build.gradle
//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
implementation 'com.squareup.okhttp3:okhttp:4.6.0'
implementation 'org.jetbrains:annotations:15.0'
don't know I'm using all latest versions and still getting this error. Help Me!
help me please
D/TAG: onCCCCC: https://cdn.coinranking.com/B1N19L_dZ/bnb.svg
E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.example.assignmentwongnai, PID: 31665
java.lang.NumberFormatException: multiple points
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1914)
at sun.misc.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
at java.lang.Float.parseFloat(Float.java:451)
at com.pixplicity.sharp.Sharp.parseNumbers(Sharp.java:514)
at com.pixplicity.sharp.Sharp.parseTransform(Sharp.java:561)
at com.pixplicity.sharp.Sharp.access$2900(Sharp.java:90)
at com.pixplicity.sharp.Sharp$SvgHandler.pushTransform(Sharp.java:1650)
at com.pixplicity.sharp.Sharp$SvgHandler.startElement(Sharp.java:1956)
at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:151)
at org.apache.harmony.xml.ExpatParser.appendBytes(Native Method)
at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:523)
at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:484)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:322)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:285)
at com.pixplicity.sharp.Sharp$SvgHandler.read(Sharp.java:1309)
at com.pixplicity.sharp.Sharp.getSharpPicture(Sharp.java:390)
at com.pixplicity.sharp.Sharp.getSharpPicture(Sharp.java:412)
at com.pixplicity.sharp.Sharp.getDrawable(Sharp.java:358)
at com.pixplicity.sharp.Sharp.into(Sharp.java:309)
at com.example.assignmentwongnai.Utils$1.onResponse(Utils.java:39)
at okhttp3.RealCall$AsyncCall.run(RealCall.kt:138)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
I/Process: Sending signal. PID: 31665 SIG: 9
Disconnected from the target VM, address: 'localhost:8617', transport: 'socket'
Most helpful comment
;( If you are using logging interceptor you also need to properly version that:
If you are using LoganSquare you also need: