UdaraWanasinghe / webp-android

libwebp JNI bindings to encode a series of Android bitmap images to an animated WebP image.
MIT License
14 stars 0 forks source link

SIGABRT when trying to assemble webp animation #3

Closed savvasdalkitsis closed 1 year ago

savvasdalkitsis commented 1 year ago

I am getting the following native crash when i am trying to assemble the final animation:

fdsan: attempted to close file descriptor 203, expected to be unowned, actually owned by ParcelFileDescriptor 0xb7426ae
Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 11203 (FrescoDecodeExe), pid 10881 (uruphotos.debug)
Cmdline: com.savvasdalkitsis.uhuruphotos.debug
pid: 10881, tid: 11203, name: FrescoDecodeExe  >>> com.savvasdalkitsis.uhuruphotos.debug <<<
      #03 pc 0000000000066368  /data/app/~~mR7DjDPZK9WS_5FMxu3cMw==/com.savvasdalkitsis.uhuruphotos.debug-3PHVvcJqS4XvMa7XUjyCNw==/base.apk!libwebpcodec_jni.so (offset 0x3bd000) (files::writeToUri(_JNIEnv*, _jobject*, _jobject*, unsigned char const*, unsigned long)+76) (BuildId: e6321d614d2ec4b639422eedd95b6346e2a4ab41)
      #04 pc 0000000000068218  /data/app/~~mR7DjDPZK9WS_5FMxu3cMw==/com.savvasdalkitsis.uhuruphotos.debug-3PHVvcJqS4XvMa7XUjyCNw==/base.apk!libwebpcodec_jni.so (offset 0x3bd000) (Java_com_aureusapps_android_webpandroid_encoder_WebPAnimEncoder_assemble+124) (BuildId: e6321d614d2ec4b639422eedd95b6346e2a4ab41)
      #07 pc 0000000000014d9a  /data/data/com.savvasdalkitsis.uhuruphotos.debug/code_cache/.overlay/base.apk/classes10.dex (com.savvasdalkitsis.uhuruphotos.foundation.image.implementation.decoder.CustomDecoder.decode+582)
...

I have attempted to provide a file uri in two different ways:

            val file = File.createTempFile(UUID.randomUUID().toString(), ".webp")
            encoder.assemble(context, totalFrames * 200L, file.toUri())

and

            val file = File(context.cacheDir, UUID.randomUUID().toString() + ".webp")
            file.createNewFile() // also tried with and without this line
            encoder.assemble(context, totalFrames * 200L, file.toUri())
UdaraWanasinghe commented 1 year ago

Which Android version are you using?

savvasdalkitsis commented 1 year ago

Screenshot_20230627-094212.png

savvasdalkitsis commented 1 year ago

This in on a pixel 7 pro

UdaraWanasinghe commented 1 year ago

Your issue is fixed. Please update to the latest version

implementation "com.aureusapps.android:webp-android:1.0.4"