请求完成前连接已关闭 - Android ION

时间:2013-07-07 06:33:42

标签: android android-imageview android-networking ion

(113 ms) https://usermap.cvut.cz/photos/simekada: Connection error
E/MyLogs  ( 4650): connection closed before response completed.
E/MyLogs  ( 4650): java.lang.Exception: connection closed before response completed.
E/MyLogs  ( 4650): at com.koushikdutta.async.http.AsyncHttpResponseImpl$3.onCompleted(AsyncHttpResponseImpl.java:68)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncSSLSocketWrapper.report(AsyncSSLSocketWrapper.java:335)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncSSLSocketWrapper.write(AsyncSSLSocketWrapper.java:277)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncSSLSocketWrapper.handleResult(AsyncSSLSocketWrapper.java:181)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncSSLSocketWrapper.access$000(AsyncSSLSocketWrapper.java:17)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncSSLSocketWrapper$1.onDataAvailable(AsyncSSLSocketWrapper.java:91)
E/MyLogs  ( 4650): at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:33)
E/MyLogs  ( 4650): at com.koushikdutta.async.BufferedDataEmitter.onDataAvailable(BufferedDataEmitter.java:61)
E/MyLogs  ( 4650): at com.koushikdutta.async.Util.emitAllData(Util.java:20)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncNetworkSocket.onReadable(AsyncNetworkSocket.java:169)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:805)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:664)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncServer.access$700(AsyncServer.java:34)
E/MyLogs  ( 4650): at com.koushikdutta.async.AsyncServer$14.run(AsyncServer.java:612)

我使用从fragment onCreateView方法调用的以下代码加载图像。片段附加到导航抽屉视图..

ImageView imageView = (ImageView) view.findViewById(R.id.drawer_profile_picture);

        if (userAccount.getAuthToken() != null) {
            String username = userAccount.getUsername();
            String url = "https://usermap.cvut.cz/photos/" + username;
            Ion.getDefault(getActivity()).setLogging("MyLogs", Log.DEBUG);

            Ion.with(getActivity(), url)
                    .withBitmap()
                    .placeholder(R.drawable.ic_person)
                    .error(R.drawable.lion)
                    .intoImageView(imageView);
}

1 个答案:

答案 0 :(得分:1)

如果您不介意检查,我认为最近修复了此错误的根本原因:

https://github.com/koush/ion/issues/18 https://github.com/koush/AndroidAsync/issues/55

与SSL有关。