Skip to content

Error While compression The source file doesn't exist. #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Manoj-SYS-193 opened this issue Jul 4, 2020 · 7 comments
Open

Error While compression The source file doesn't exist. #157

Manoj-SYS-193 opened this issue Jul 4, 2020 · 7 comments

Comments

@Manoj-SYS-193
Copy link

Fatal Exception: h.y.k: /data/user/0/com.package/cache/compressor/IMG_2020_07_04_15_09_29_429.jpg: The source file doesn't exist.
at kotlin.io.FilesKt__UtilsKt.copyTo(FilesKt__UtilsKt.java:183)
at kotlin.io.FilesKt__UtilsKt.copyTo$default(FilesKt__UtilsKt.java:181)
at kotlin.io.FilesKt.copyTo$default(FilesKt.java)
at id.zelory.compressor.constraint.DestinationConstraint.satisfy(DestinationConstraint.java:17)
at id.zelory.compressor.Compressor$compress$3.invokeSuspend(Compressor.java:28)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:665)

@flobizDipen
Copy link

Any solution you get for this?

@premacck
Copy link

premacck commented Aug 7, 2020

I'm also facing this issue:

Fatal Exception: kotlin.io.NoSuchFileException: /data/user/0/com.package/cache/UPLOAD-49-38-38-8-4-7-2020691614128.jpg: The source file doesn't exist.
       at kotlin.io.FilesKt__UtilsKt.copyTo(FilesKt__UtilsKt.java:183)
       at kotlin.io.FilesKt__UtilsKt.copyTo$default(FilesKt__UtilsKt.java:181)
       at kotlin.io.FilesKt.copyTo$default(FilesKt.java)
       at id.zelory.compressor.UtilKt.copyToCache(UtilKt.java:82)
       at id.zelory.compressor.Compressor$compress$3.invokeSuspend(Compressor.java:25)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:56)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:571)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:738)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:678)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:665)

I think this issue needs to be addressed, I've been facing scattered crashes with this stacktrace in my production app, it may be an edge case issue, or it may be a ticking time bomb 🤔

@premacck
Copy link

premacck commented Aug 8, 2020

Created Pull request for the same here: #161

@Pradeep0801
Copy link

Pradeep0801 commented Oct 13, 2020

Fatal Exception: kotlin.io.NoSuchFileException: /storage/emulated/0/Android/media
The source file doesn't exist.
at kotlin.io.FilesKt__UtilsKt.copyTo(Utils.kt:183)
at kotlin.io.FilesKt__UtilsKt.copyTo$default(Utils.kt:181)
at id.zelory.compressor.UtilKt.copyToCache(Util.kt:82)
at id.zelory.compressor.Compressor$compress$3.invokeSuspend(Compressor.kt:25)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)

Device Details
Device
Brand: vivo
Model: vivo 1907
Orientation: Portrait
RAM free: 1.1 GB
Disk free: 82.69 GB
Operating System
Version: 10
Orientation: Portrait
Rooted: No

@amrro
Copy link

amrro commented Oct 25, 2020

This might be related to this issue:
#159 (comment)

@nareshkatta99
Copy link

nareshkatta99 commented Oct 25, 2020

@premacck @Pradeep0801 @Manoj-SYS-193
Any one of you, can you please provide some minimal source code to reproduce the issue?
I'm not getting the issue if I'm using the example app.

If it is coming due to specific File Manager or Gallery app, please let us know that as well.

@bymomo
Copy link

bymomo commented Jan 15, 2025

Solved, copy the code from this file and use the methods inside to convert the URI to file.
https://github.com/zetbaitsu/Compressor/blob/master/app/src/main/java/id/zelory/compressor/sample/FileUtil.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants