When I am calling the socket.connect() then I am getting the following crash.
java.lang.NoSuchMethodError: No virtual method callEngineGetConnection(Lcom/squareup/okhttp/Call;)Lcom/squareup/okhttp/Connection; in class Lcom/squareup/okhttp/internal/Internal; or its super classes (declaration of 'com.squareup.okhttp.internal.Internal' appears in /data/app/~~gH8GYdOH_Pgz875AzCtz-Q==/com.india.smart_life-JwkT5ZHHQZdTEv4U1b6TOg==/base.apk!classes2.dex)
at com.squareup.okhttp.ws.WebSocketCall.createWebSocket(WebSocketCall.java:154)
at com.squareup.okhttp.ws.WebSocketCall.access$000(WebSocketCall.java:42)
at com.squareup.okhttp.ws.WebSocketCall$1.onResponse(WebSocketCall.java:102)
at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:177)
at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
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:923)
And This crash is coming only above and android 10 devices. I have tried all the possible ways but unable to find out the solution.
Following library, I am using in my application.
implementation 'com.github.nkzawa:socket.io-client:0.6.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.7.5'
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1'
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
If you need any extra information please let me know I will give you.
Hi! It might be linked to the okhttp version.
Could you please test with latest io.socket:socket.io-client:1.0.1, which includes com.squareup.okhttp3:okhttp:jar:3.12.12?
Yes, You are right. I have solved this issue before few days back.