fluttercommunity/flutter_downloader

I encounter failure while downloading some files, although it succeeds in downloading other files

mohammadbat opened this issue · 2 comments

Uploading Screenshot 2023-12-20 225605.png…
this error show !!
Update notification: {notificationId: 24, title: https://drive.google.com/uc?export=download&id=14IncUOyBeXpFKJECVirkpcqoKeNhIsxQ, status: FAILED, progress: -1}
I/flutter (15751): Background Isolate Callback: taskid (1fa03720-2d0b-4c6e-8f6f-1e1c56854ab3) is in Status (4) and progress (-1)
W/System.err(15751): java.net.SocketTimeoutException: timeout
W/System.err(15751): at com.android.okhttp.okio.Okio$3.newTimeoutException(Okio.java:221)
W/System.err(15751): at com.android.okhttp.okio.AsyncTimeout.exit(AsyncTimeout.java:261)
W/System.err(15751): at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:215)
W/System.err(15751): at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:316)
W/System.err(15751): at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:310)
W/System.err(15751): at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:206)
W/System.err(15751): at com.android.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:395)
W/System.err(15751): at com.android.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:144)
W/System.err(15751): at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:887)
W/System.err(15751): at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:759)
W/System.err(15751): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:498)
W/System.err(15751): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:434)
W/System.err(15751): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:565)
W/System.err(15751): at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
W/System.err(15751): at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:26)
W/System.err(15751): at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.kt:321)
W/System.err(15751): at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.kt:206)
W/System.err(15751): at androidx.work.Worker$1.run(Worker.java:86)
W/System.err(15751): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err(15751): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err(15751): at java.lang.Thread.run(Thread.java:764)
W/System.err(15751): Caused by: java.net.SocketException: socket is closed
W/System.err(15751): at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:584)
W/System.err(15751): at com.android.okhttp.okio.Okio$2.read(Okio.java:141)
W/System.err(15751): at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)

the soulotion is increment timeout

Need a callback for timeout error from the package.

It can be taken as an improvement.