AbedElazizShe / LightCompressor

A powerful and easy-to-use video compression library for android uses MediaCodec API.
Apache License 2.0
533 stars 116 forks source link

IllegalStateException: Failed to build unique file #180

Open akrulec opened 1 year ago

akrulec commented 1 year ago

Hi,

I'm using this library for some video uploading, and I keep seeing this error pop up in Firebase Crashlytics:

Fatal Exception: java.lang.IllegalStateException
Failed to build unique file: /storage/emulated/0/Movies/compressed_video_temp.mp4 bucket_display_name=Movies volume_name=external_primary date_modified=null date_expires=null _display_name=compressed_video_temp.mp4 mime_type=video/mp4 _data=/storage/emulated/0/Movies/compressed_video_temp.mp4 _size=null is_trashed=0 is_pending=0 bucket_id=-1730634595 relative_path=Movies/

Full stack:

android.os.Parcel.createExceptionOrNull (Parcel.java:3065)
android.os.Parcel.createException (Parcel.java:3041)
android.os.Parcel.readException (Parcel.java:3024)
android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:190)
android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:142)
android.content.ContentProviderProxy.update (ContentProviderNative.java:685)
android.content.ContentResolver.update (ContentResolver.java:2416)
android.content.ContentResolver.update (ContentResolver.java:2378)
com.abedelazizshe.lightcompressorlibrary.VideoCompressor.saveVideoInExternal (VideoCompressor.kt:343)
com.abedelazizshe.lightcompressorlibrary.VideoCompressor.saveVideoFile (VideoCompressor.kt:237)
com.abedelazizshe.lightcompressorlibrary.VideoCompressor.access$saveVideoFile (VideoCompressor.kt)
com.abedelazizshe.lightcompressorlibrary.VideoCompressor$doVideoCompression$1.invokeSuspend (VideoCompressor.kt:152)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106)
android.os.Handler.handleCallback (Handler.java:958)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:205)
android.os.Looper.loop (Looper.java:294)
android.app.ActivityThread.main (ActivityThread.java:8177)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:552)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:971)

Any idea what we might be doing wrong?

rachit1797 commented 10 months ago

Getting a Similar Issue. Any Solution?

rachit1797 commented 9 months ago

@AbedElazizShe Any Update on this?