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.

android.resource Uris that point to another package's resource ID fail to load

See original GitHub issue

Describe the bug imageView.load(uri) doesn’t load image from android.resource:// uri.

To Reproduce

  1. Apply this patch to coil sample app.
  2. Run sample app
  3. Notice icon image is not loaded.
  4. To check expected result comment out detail.load(uri) and un-comment detail.setImageURI(uri)

Expected behavior Image loaded from uri

Logs/Screenshots

Current Expected
Screenshot_1566084096 Screenshot_1566083962

Library version 0.6.1

tested on Android 10

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
colinrtwhitecommented, Aug 19, 2019

Confirmed. android.resource Uris that point to a vector drawable (or anything that can’t be handled by BitmapFactory currently won’t load correctly. Have an idea in mind of how to fix this and will make sure the fix makes it into 0.7.0.

As a work around you can pass the resource ID directly to load: .load(R.drawable.image)

0reactions
colinrtwhitecommented, Sep 10, 2019

Thanks, I’ll take a look into this next week (away on holiday this week).

Read more comments on GitHub >

github_iconTop Results From Across the Web

App resources overview - Android Developers
This document shows you how to group your resources in your Android project and provide alternative resources for specific device configurations ...
Read more >
Error - Android resource linking failed (AAPT2 27.0.3 Daemon ...
According to the above error, the first thing you need to do is to proof read all the drawable resources that are accessed...
Read more >
Image - .NET MAUI | Microsoft Learn
The .NET MAUI Image displays an image that can be loaded from a local file, a URI, an embedded resource, or a stream....
Read more >
Location-Independent Access to Resources
home") , then add "/lib/resource", and open that file. Methods in the classes Class and ClassLoader provide a location-independent way to locate resources....
Read more >
Loading JSON data from Cloud Storage | BigQuery
If you include a generation number in the Cloud Storage URI, then the load job fails. When you load JSON files into BigQuery,...
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