koush / ion

Android Asynchronous Networking and Image Loading
Other
6.29k stars 1.03k forks source link

Fatal Exception: java.lang.AssertionError double connect callback #914

Open duranun opened 5 years ago

duranun commented 5 years ago

Fatal Exception: java.lang.AssertionError: double connect callback at com.koushikdutta.async.http.AsyncHttpClient$3.a(AsyncHttpClient.java:30) at com.koushikdutta.async.http.AsyncSSLSocketMiddleware$1.a(AsyncSSLSocketMiddleware.java:2) at com.koushikdutta.async.AsyncSSLSocketWrapper.a(AsyncSSLSocketWrapper.java:230) at com.koushikdutta.async.AsyncSSLSocketWrapper.write(AsyncSSLSocketWrapper.java:13) at com.koushikdutta.async.AsyncSSLSocketWrapper.a(AsyncSSLSocketWrapper.java:19) at com.koushikdutta.async.AsyncSSLSocketWrapper.access$000(AsyncSSLSocketWrapper.java:10) at com.koushikdutta.async.AsyncSSLSocketWrapper$6.onDataAvailable(AsyncSSLSocketWrapper.java:10) at com.koushikdutta.async.Util.emitAllData(Util.java:2) at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:2) at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:13) at com.koushikdutta.async.AsyncServer.post(AsyncServer.java:2) at com.koushikdutta.async.AsyncServer.access$800(AsyncServer.java:3) at com.koushikdutta.async.AsyncServer$11.run(AsyncServer.java:3)

jaooheavy commented 4 years ago

Fatal Exception: java.lang.AssertionError: double connect callback at com.koushikdutta.async.http.AsyncHttpClient$3.onConnectCompleted(AsyncHttpClient.java:261) at com.koushikdutta.async.http.AsyncSSLSocketMiddleware$1.onHandshakeCompleted(AsyncSSLSocketMiddleware.java:83) at com.koushikdutta.async.AsyncSSLSocketWrapper.handleHandshakeStatus(AsyncSSLSocketWrapper.java:433) at com.koushikdutta.async.AsyncSSLSocketWrapper.write(AsyncSSLSocketWrapper.java:503) at com.koushikdutta.async.AsyncSSLSocketWrapper.handleHandshakeStatus(AsyncSSLSocketWrapper.java:378) at com.koushikdutta.async.AsyncSSLSocketWrapper.access$000(AsyncSSLSocketWrapper.java:72) at com.koushikdutta.async.AsyncSSLSocketWrapper$6.onDataAvailable(AsyncSSLSocketWrapper.java:315) at com.koushikdutta.async.Util.emitAllData(Util.java:23) at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:163) at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:869) at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:717) at com.koushikdutta.async.AsyncServer.access$800(AsyncServer.java:46) at com.koushikdutta.async.AsyncServer$11.run(AsyncServer.java:671)

imattaullah commented 4 years ago

same issue but no support from such a repository. have you any solution???

Alan72528 commented 3 years ago

Same issue here. Refer to https://github.com/koush/ion/issues/937#issuecomment-723546242 and already update to version 3.1.0 But still get crash log and most cases occur on android 10 & 11 I saw the source code will throw assert if onConnectCompleted is called twice

public void onConnectCompleted(Exception ex, AsyncSocket socket) {
            if (reported) {
                if (socket != null) {
                    socket.setDataCallback(new DataCallback.NullDataCallback());
                    socket.setEndCallback(new CompletedCallback.NullCompletedCallback());
                    socket.close();
                    throw new AssertionError("double connect callback");
                }
            }
            reported = true;
            ...
}

Is there any other solution to avoid the error?

ChristopheVersieux commented 2 years ago

I know this issue has been reported 3 years ago, but this is still something I see in the dev console from time to time. Even on latest ion version