nkzawa / socket.io-android-chat

A simple chat demo for socket.io and Android
MIT License
2k stars 693 forks source link

This has a conflict with okhttp dispatcher (retrofit) #29

Open whowazit opened 8 years ago

whowazit commented 8 years ago

I tried to connect using this library and I'm also using okhttp for some api request but it has a conflict with okhttp dispatcher.

03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher 03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: java.lang.NoSuchMethodError: com.squareup.okhttp.internal.Internal.callEngineGetConnection 03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: at com.squareup.okhttp.ws.WebSocketCall.createWebSocket(WebSocketCall.java:154) 03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: at com.squareup.okhttp.ws.WebSocketCall.access$000(WebSocketCall.java:42) 03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: at com.squareup.okhttp.ws.WebSocketCall$1.onResponse(WebSocketCall.java:102) 03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:177) 03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33) 03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 03-10 13:39:12.721 5216-5275/com.shima.thebizgames E/AndroidRuntime: at java.lang.Thread.run(Thread.java:856)

TheWeakestLink commented 8 years ago

I have the same problem too and can't seem to find a fix yet. I'm also using Retrofit and Socket.io

bingdow commented 8 years ago

In my case don't really need to include okhttp in build.gradle file can still use it and make it work with Retrofit. After remove okhttp in app/build.gradle file everything seems okay.