Compressor icon indicating copy to clipboard operation
Compressor copied to clipboard

File already exist exception when attempting to compress some images (random)

Open YsrBouhamria opened this issue 2 years ago • 1 comments

Hey, I keep getting this crash on some instances, can't really reproduce, any idea what could be wrong? It happens in devices running android 8, until 13 Fatal Exception: kotlin.io.FileAlreadyExistsException: /data/user/0/com.my.app/files/IMG_20230531_100341.jpg -> /data/user/0/com.my.app/cache/compressor/IMG_20230531_100341.jpg: Tried to overwrite the destination, but failed to delete it. at kotlin.io.FilesKt__UtilsKt.copyTo(Utils.kt:226) at kotlin.io.FilesKt__UtilsKt.copyTo$default(Utils.kt:217) 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(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

YsrBouhamria avatar Jun 19 '23 08:06 YsrBouhamria

Did you find any solution?

rohitjakhar avatar Aug 23 '23 16:08 rohitjakhar