Open slavomirhay opened 3 months ago
Any update ?
java.lang.NullPointerException vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.kt:395) vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.kt:206) androidx.work.Worker$1.run(Worker.java:86) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) java.lang.Thread.run(Thread.java:1012) Worker result FAILURE for Work [ id=27b8335d-b42d-4736-a76d-2c496b9f131c, tags={ flutter_download_task, vn.hunghd.flutterdownloader.DownloadWorker } ]
I faced the same issue, I had to modify those functions and insert them in try/catch to not break.
Throws when file already exists after enqueue and there was no task for it before. Maybe do something like showDialog AlertDialog or verify file already downloaded or continue downloading if it was only partially downloaded. I can do it but choose an option.
(DownloadWorker.kt:394) val file = createFileInAppSpecificDir(actualFilename!!, savedDir) (DownloadWorker.kt:395) savedFilePath = file!!.path
I/NotificationManager(32113): com.my.stuff.app: notify(31, null, Notification(channel=FLUTTER_DOWNLOADER_NOTIFICATION shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x18 color=0x00000000 vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)) as user W/System.err(32113): java.lang.NullPointerException W/System.err(32113): at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.kt:395) W/System.err(32113): at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.kt:206) W/System.err(32113): at androidx.work.Worker$1.run(Worker.java:82) W/System.err(32113): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) W/System.err(32113): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) W/System.err(32113): at java.lang.Thread.run(Thread.java:1012) I/WM-WorkerWrapper(32113): Worker result FAILURE for Work [ id=0d66443b-2b46-4c57-be0c-7405e12bf1ac, tags={ vn.hunghd.flutterdownloader.DownloadWorker, flutter_download_task } ] D/ConnectivityManager(32113): StackLog: [android.net.ConnectivityManager.unregisterNetworkCallback(ConnectivityManager.java:5076)] [androidx.work.impl.utils.NetworkApi21.unregisterNetworkCallbackCompat(NetworkApi21.kt:31)] [androidx.work.impl.constraints.trackers.NetworkStateTracker24.stopTracking(NetworkStateTracker.kt:153)] [androidx.work.impl.constraints.trackers.ConstraintTracker.removeListener(ConstraintTracker.kt:72)] [androidx.work.impl.constraints.controllers.ConstraintController$track$1$1.invoke(ContraintControllers.kt:56)] [androidx.work.impl.constraints.controllers.ConstraintController$track$1$1.invoke(ContraintControllers.kt:55)] [kotlinx.coroutines.channels.ProduceKt.awaitClose(Produce.kt:54)] [kotlinx.coroutines.channels.ProduceKt$awaitClose$1.invokeSuspend(Unknown Source:13)] [kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)] [kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)] [androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)] [java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)] [java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)] [java.lang.Thread.run(Thread.java:1012)]