fix(Android, Tabs): Fix tabs icons loading in release mode #3413
+82
−41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR improves the approach to loading image assets used as tab icons, addressing issues with inconsistent or unreliable URI resolution - particularly around local resources and assets in Android builds (debug vs. release).
Previously, the image loading logic assumed that assets would always be bundled with a
_prefix in release builds. However, this is not a reliable assumption and can break under certain project setups or custom bundling configurations. Assets are now resolved directly using the appropriateandroid.resourceorandroid_assetURI schemes.Additionally, now I'm resolving both drawable and raw into the
res:/<id>URI format before being converted to the properandroid.resource://URI expected by Fresco. This ensures consistent behavior regardless of resource type.This change ensures that both local resources and bundled assets are correctly rendered as tab icons across different build variants, without relying on unstable heuristics.
Fixes #3399
Changes
Screenshots / GIFs
Here you can add screenshots / GIFs documenting your change.
You can add before / after section if you're changing some behavior.
Before
Debug:

Release:

After
Debug:

Release:

Test code and steps to reproduce
It's working fine it both debug and release in our examples, before and after applying these changes. Therefore, I was testing it on a separate application with this code snippet:
I'm adding
custom_home_iconvia android resource manager and other icons viaassets/directoryChecklist