novoda / download-manager

A library that handles long-running downloads, handling the network interactions and retrying downloads automatically after failures
Apache License 2.0
483 stars 63 forks source link

DownloadsNetworkRecoveryCreator not initialised #499

Closed tobiasheine closed 5 years ago

tobiasheine commented 5 years ago

From our logs:

Fatal Exception: java.lang.IllegalStateException: There is no instance available, make sure you call DownloadsNetworkRecoveryCreator.create(...) first at com.novoda.downloadmanager.DownloadsNetworkRecoveryCreator.getInstance(DownloadsNetworkRecoveryCreator.java:23) at com.novoda.downloadmanager.DownloadBatch.processNetworkError(DownloadBatch.java:178) at com.novoda.downloadmanager.DownloadBatch.shouldAbortStartingBatch(DownloadBatch.java:129) at com.novoda.downloadmanager.DownloadBatch.download(DownloadBatch.java:63) at com.novoda.downloadmanager.LiteDownloadService.download(LiteDownloadService.java:61) at com.novoda.downloadmanager.LiteDownloadService.start(LiteDownloadService.java:33) at com.novoda.downloadmanager.LiteDownloadService$$Lambda$0.run(LiteDownloadService.java) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)

tobiasheine commented 5 years ago

Could be due to a race condition in com.novoda.downloadmanager.DownloadManagerBuilder#build where we first initialise the LiteDownloadManager and then create the DownloadsNetworkRecovery.

tobiasheine commented 5 years ago

Fix will be released as part of 2.3.2