question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot load Adaptive Icons (ProgressiveDecoder: unknown image format)

See original GitHub issue

Description

Trying to load the URI identifier for installed applications icons fails for some apps (system and non-system) and throws some logs:

D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.sonymobile.synchub/2131427328, firstEncodedBytes: 03000800840100000100, length: 388} D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.calendar/2130903042, firstEncodedBytes: 03000800480200000100, length: 584} D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.android.chrome/2131231050, firstEncodedBytes: 03000800540100000100, length: 340} D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.sonyericsson.organizer/2130903043, firstEncodedBytes: 03000800C80100000100, length: 456} D/skia: — SkAndroidCodec::NewFromStream returned null D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.apps.docs.editors.docs/2130838355, firstEncodedBytes: 030008008C0200000100, length: 652} D/skia: — SkAndroidCodec::NewFromStream returned null D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.apps.docs/2130837900, firstEncodedBytes: 03000800280200000100, length: 552} D/skia: — SkAndroidCodec::NewFromStream returned null D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.sonymobile.email/2130903040, firstEncodedBytes: 03000800280200000100, length: 552} D/skia: — SkAndroidCodec::NewFromStream returned null D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://flar2.exkernelmanager/2131558401, firstEncodedBytes: 03000800F40100000100, length: 500} D/skia: — SkAndroidCodec::NewFromStream returned null D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.inputmethod.latin/2130903043, firstEncodedBytes: 03000800280200000100, length: 552} D/skia: — SkAndroidCodec::NewFromStream returned null D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.gm/2130903042, firstEncodedBytes: 03000800280200000100, length: 552} D/skia: — SkAndroidCodec::NewFromStream returned null D/skia: — SkAndroidCodec::NewFromStream returned null W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.googlequicksearchbox/2130903051, firstEncodedBytes: 03000800C80100000100, length: 456}

As seen in logs, it fails for applications like Chrome Browser, Docs, GMail, Google Calendar or even System keyboard

Reproduction

Just retrieve ApplicationInfo to access ApplicationInfo.icon class field, then parse the URI for such icon identifier and try to load:

LOADER

List<ApplicationInfo> appInfos = mPackageManager.getInstalledApplications(0);

LIST(RECYCLER)VIEW ADAPTER

ApplicationInfo info = appInfos.get(position);
if (info.icon != 0) {
    Uri uri = Uri.parse("android.resource://" + packageName + "/" + info.icon);
    holder.appIconSimpleDraweeView.setImageURI(uri);
}

Additional Information

  • Fresco version: 1.10.0
  • Platform version:
    • Sony Xperia X Compact : Android Oreo 8.0.0
    • Samsung Galaxy S8 : Android Oreo 8.0.0

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
oprisnikcommented, Aug 7, 2018

Fresco also supports custom decoder, so you can just add a custom decoder that handles the image properly (http://frescolib.org/docs/customizing-image-formats.html). Then, you don’t need to build from source but just experiment with a custom decoder in your app and make it work. And as Daniel mentioned, pull requests are welcome.

0reactions
fushenghuacommented, Sep 4, 2018

good @oprisnik

Read more comments on GitHub >

github_iconTop Results From Across the Web

Some Images not rendered on react native Android (release ...
For some reason I don't understand, some images of my app do not render in Android release mode. The only log in logcat...
Read more >
Adaptive icons - Android Developers
An adaptive icon, or AdaptiveIconDrawable , can display differently depending on individual device capabilities and user theming.
Read more >
Android Icon Troubleshooting - App Distribution & Beta Testing for ...
When using Android Adaptive Icons, there is a chance that icons are not correctly displayed in Updraft. Here's how you can get the...
Read more >
Apple Icon Image format - Wikipedia
The Apple Icon Image format is an icon format used in Apple Inc.'s macOS. It supports icons of 16 × 16, 32 ×...
Read more >
Image Asset Studio doesn't overwrite all old files when ...
The resulting adaptive icon is a mix of the new and old foreground / background layers. I've attached the new ic_launcher_foreground.xml and ...
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