D/skia: --- Failed to create image decoder with message 'unimplemented'
Asked Answered
S

4

31

i am using https://github.com/jhansireddy/AndroidScannerDemo this scan library in my project.

when i capture image i am getting D/skia: --- Failed to create image decoder with message 'unimplemented' in console and The captured image not sets to imageview in Android P.

also when i am testing same app in Android Q i am getting below error.

2020-02-05 11:32:23.668 9270-9270/? E/ReviewScreenImpl: onClickOKButton() - Fail to decode captured picture

Can someone please help on above issues.

Succubus answered 5/2, 2020 at 6:22 Comment(6)
have you created an issue for this on their github ?Dissociable
yes i have created issue on github but before also i have created 2,3 issues there and not got any response.Succubus
just making sure, it's usually a good idea to make an issue on githubDissociable
any solution to this ?Kala
I get this error when using new activity result api for camera resultKala
I also had the same problem when using Activity Result API for camera result. Solution: https://mcmap.net/q/471923/-activityresultcontracts-takepicture-image-is-not-saved-after-activity-orientation-change This error message ('unimplemented') occurred because the image file was empty (0 bytes) in my case.Cahn
M
4

I have the same problem and it seems there is a bug in getResources not in library you used because I don`t use it. but, you can use ResourcesCompat instead, like this:

val myLogo = (ResourcesCompat.getDrawable(this.resources, R.drawable.ic_home_black_24dp, null) as VectorDrawable).toBitmap()

or

val myLogo = (ResourcesCompat.getDrawable(this.resources, R.drawable.ic_home_black_24dp, null) as BitmapDrawable).bitmap

depend on your drawable type(vector or image).

be aware that this will only run on API > 22.

Matti answered 31/3, 2020 at 11:16 Comment(0)
B
0

Make sure you have generated the image Uri which you will be sending with Intent to the camera app with the FileProvider.

The image uri where the camera app will save the picture before returning Activity.RESULT_OK should be generated with FileProvider like this

FileProvider.getUriForFile(
        context,
        context.getString(R.string.file_sharing_authority),
        File(filePath)

For more information about how to share our file to other apps (like the camera app) to be read or written into, see https://developer.android.com/reference/androidx/core/content/FileProvider

Blub answered 2/10, 2020 at 18:8 Comment(0)
P
0

This bug originates from Android Studio emulator and probably has nothing to do with the API/library you choose, whether in native Android or Flutter. I had this problem once in a while, where it only took place in emulator. All network/online pictures can't be displayed on app and above error messages were shown all over the place. My app ran fine on my USB connected phone though.

Updating/redownloading the image for the emulator fixed the issue.

Piranha answered 15/6, 2023 at 2:56 Comment(0)
T
-1

Please pass the image byte string, instead of passing a simple string, into your decoder BitmapFactory.decodeStream method.

Teleview answered 20/8, 2020 at 19:22 Comment(1)
Can you provide code ?Watermark

© 2022 - 2024 — McMap. All rights reserved.