Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.9.0
-
None
-
None
-
Android
Description
Cordova 2.9.1. Using FileTransfer plugin.
When upgrading the project's OkHttp version to 1.5, it frequently crashes due to a broken assumption made by Cordova that HttpURLConnection is thread safe.
On Android it is explicitly not thread safe: http://developer.android.com/reference/java/net/HttpURLConnection.html
Short discussion: https://github.com/square/okhttp/issues/655
Stack trace:
java.lang.NullPointerException
at com.squareup.okhttp.internal.okio.OkBuffer.write(OkBuffer.java:519)
at com.squareup.okhttp.internal.okio.OkBuffer.read(OkBuffer.java:555)
at com.squareup.okhttp.internal.okio.RealBufferedSource.read(RealBufferedSource.java:53)
at com.squareup.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:413)
at com.squareup.okhttp.internal.Util.skipAll(Util.java:234)
at com.squareup.okhttp.internal.http.HttpConnection.discard(HttpConnection.java:183)
at com.squareup.okhttp.internal.http.HttpConnection$FixedLengthSource.close(HttpConnection.java:435)
at com.squareup.okhttp.internal.okio.RealBufferedSource.close(RealBufferedSource.java:206)
at com.squareup.okhttp.internal.okio.RealBufferedSource$1.close(RealBufferedSource.java:181)
at java.io.FilterInputStream.close(FilterInputStream.java:64)
at org.apache.cordova.FileTransfer.safeClose(FileTransfer.java:515)
at org.apache.cordova.FileTransfer.access$300(FileTransfer.java:64)
at org.apache.cordova.FileTransfer$5.run(FileTransfer.java:864)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
Attachments
Issue Links
- relates to
-
CB-8431 File Transfer tests crash on Android Lolipop
- Closed