Failed to create image decoder with message 'unimplemented'

See original GitHub issue

Getting the following debug message on app startup (emulator Pixel 3A, API 29)

2020-05-14 13:14:36.381 12259-12305/com.example.android.uamp.next D/skia: --- Failed to create image decoder with message 'unimplemented'

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
niektuytelcommented, Nov 18, 2020

for me this happens when converting Drawable to byte[], this did work:

public static Bitmap drawableToBitmap (Drawable drawable) {
        Bitmap bitmap = null;

        if (drawable instanceof BitmapDrawable) {
            BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
            if(bitmapDrawable.getBitmap() != null) {
                return bitmapDrawable.getBitmap();
            }
        }

        if(drawable.getIntrinsicWidth() <= 0 || drawable.getIntrinsicHeight() <= 0) {
            bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); // Single color bitmap will be created of 1x1 pixel
        } else {
            bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
        }

        Canvas canvas = new Canvas(bitmap);
        drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
        drawable.draw(canvas);
        return bitmap;
    }

// icon
        Drawable test = mActivity.getDrawable(R.drawable.ic_apps_black_24dp);
        Bitmap bmp = drawableToBitmap(test);
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
        byte[] byteArray = stream.toByteArray();
        bmp.recycle();




0reactions
hgarciaalbertocommented, Jan 27, 2022

I’ve found this and it may help:

val markerOption = MarkerOptions().apply {
    position(LatLng(driver.lat, driver.lng))
    icon(R.drawabel.your_drawable.toBitmapDescriptor(context))
    snippet(driver.driverId.toString())
}
mMap.addMarker(markerOption)
fun Int.toBitmapDescriptor(context: Context): BitmapDescriptor {
    val vectorDrawable = ResourcesCompat.getDrawable(context.resources, this, context.theme)
    val bitmap = vectorDrawable?.toBitmap(
        vectorDrawable.intrinsicWidth,
        vectorDrawable.intrinsicHeight,
        Bitmap.Config.ARGB_8888
    )
    return BitmapDescriptorFactory.fromBitmap(bitmap!!)
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

D/skia: --- Failed to create image decoder with message ...
when i capture image i am getting D/skia: --- Failed to create image decoder with message 'unimplemented' in console and The captured image...
Read more >
Android – D/skia: — Failed to create image decoder with ...
Go to Project » Properties » Java Build Path » Libraries and remove all except the "Android X.Y" (in my case Android 1.5)....
Read more >
Images load on iOS, but not on Android.
[skia] --- Failed to create image decoder with message 'unimplemented' - The URL loads fine within the browser - We have our settings...
Read more >
ImageDecoder.DecodeException - Android Developers
Returns the detail message string of this throwable. ... This can be used for equality checking to find the Source which failed to...
Read more >
Failed To Create Image Decoder With Message ... - ADocLib
E/Drawable: Unable to decode stream: android.graphics.ImageDecoderDecodeException: Failed to create image decoder with message 'unimplemented'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found