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

标签 android android-camera android-manifest android-fileprovider

我正在使用 https://github.com/jhansireddy/AndroidScannerDemo我项目中的这个扫描库。

当我捕获图像时,我得到 D/skia: --- Failed to create image decoder with message 'unimplemented'在控制台中,捕获的图像未设置为 中的 ImageView 安卓P .

当我在 中测试相同的应用程序时安卓Q 我得到以下错误。
2020-02-05 11:32:23.668 9270-9270/? E/ReviewScreenImpl: onClickOKButton() - Fail to decode captured picture
有人可以帮助解决上述问题。

最佳答案

我有同样的问题,getResources 中似乎有一个错误,不在您使用的库中,因为我不使用它。但是,您可以改用 ResourcesCompat,如下所示:

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

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

取决于您的可绘制类型(矢量或图像)。

请注意,这只会在 API > 22 上运行。

关于android - D/skia : --- Failed to create image decoder with message 'unimplemented' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60070017/

相关文章:

安卓 Nexus 7 果冻 bean : startPreview/takePicture calling getCameraStereoMode logs an error

android - 相机预览没有重新启动?

java - FileInputStream 在skip()调用后留下奇怪的垃圾文本

Android onTouchEvent()连续触摸导致system_server GC

android - Android中这两种拍照方式有什么区别?

android - 使用 startInstrumentation 检测 Android 应用程序

java - 在 Android 中,如何将 View 附加到软键盘?

java - Android Studio 3.0 - "Failed to transform file ' gson-2.2.4.jar' 匹配属性 {artifactType=android-classes}”

android - 从 Activity 启动 Android init.rc 服务

android - com.google.android.geo.api_key 和 com.google.android.maps.v2.api_key 之间的区别?