Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 716
Ajinkya kadam Avatar asked Feb 05 '20 06:02

Ajinkya kadam


1 Answers

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.

like image 176
kAvEh Avatar answered Nov 18 '22 10:11

kAvEh