coolerfall / Android-HttpDownloadManager

An useful and effective http/https download manager for Android, support breakpoint downloading.
https://ahdm.coolerfall.com
Apache License 2.0
200 stars 43 forks source link

shared storage is not currently available #92

Closed Moseqi closed 1 year ago

Moseqi commented 2 years ago

Getting NPE on Vivo devices

Runs with Android versions 6.0.1 and 8.1.0

Stacktrace

Fatal Exception: java.lang.NullPointerException: shared storage is not currently available at java.util.Objects.requireNonNull(Objects.java:109) at com.coolerfall.download.Preconditions.checkNotNull(Preconditions.java) at com.coolerfall.download.DownloadManager.(DownloadManager.java) at com.coolerfall.download.DownloadManager$Builder.build(DownloadManager.java) at com...getConfigValue(Utils.java) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.java) at kotlinx.coroutines.scheduling.TaskImpl.run(TaskImpl.java) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java)

coolerfall commented 1 year ago

Check storage first yourself.

Moseqi commented 1 year ago

Check storage first yourself.

Checked and working fine, Thanks. P.s storage is working fine, the bug is still persist.

coolerfall commented 1 year ago

DownloadManager uses context.getExternalFilesDir to get download directory. If this is not available, it means you have no permission to use it.