You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Android] Assets with the same name and different extension don't work properly [7.0] #9618
difficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/bugSomething isn't workinglow-hanging-🍒Categorizes an issue that might be a quick win with meaningful positive impact.no-reproplatform/android 🤖Categorizes an issue or PR as relevant to the Android platformproject/core-tools 🛠️Categorizes an issue or PR as relevant to core and tools
Suppose the Assets folder in Shared project contains the following:
Image.png
Image.jpg
Even though both are different actual files, when used in <Image> they are retrieved by DrawableHelper using their "id" which is using GetFileNameWithoutExtension. As a result, only one will display.
Expected behavior
Should allow displaying multiple images with the same name and different extension.
How to reproduce it (as minimally and precisely as possible)
This can be fixed by adjusting the assets retarget task to include the file extension in the file name (e.g. drawables will contain something like Assets_Image_jpg.jpg and Assets_Image_png.png). Then we can use the filename with extension to get the image
Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.
changed the title [-][Android] Assets with the same name and different extension don't work properly[/-][+][Android] Assets with the same name and different extension don't work properly [7.0
][/+]on Aug 9, 2026
changed the title [-][Android] Assets with the same name and different extension don't work properly [7.0
][/-][+][Android] Assets with the same name and different extension don't work properly [7.0][/+]on Aug 9, 2026
Audit result: NOT STARTED in feature/breakingchanges (as of 0950717a0d7).
The Android drawable key-collision bug the issue reports is unfixed on the branch — the lookup and retarget code are byte-identical to origin/master, only relocated by the unrelated Uno.UWP → Uno.WinRT project move. The fix exists as a stalled draft PR (#15891, targets master, blocked on a nine-patch regression) and is tracked, unchecked, as BC74 in the breaking-changes rollup.
Remaining
Drawable lookup still strips the extension before resolving.src/Uno.WinRT/Helpers/DrawableHelper.Android.cs:48 (FindResourceId) computes its lookup key via AndroidResourceNameEncoder.Encode(System.IO.Path.GetFileNameWithoutExtension(imageName)), and :87 (FindResourceIdFromPath) does the same via Path.GetFileNameWithoutExtension(AndroidResourceNameEncoder.EncodeDrawablePath(imagePath)) — extension is discarded either way, so Image.png and Image.jpg still resolve to the same key. diff <(git show origin/master:src/Uno.UWP/Helpers/DrawableHelper.Android.cs) src/Uno.WinRT/Helpers/DrawableHelper.Android.cs returns no differences; git log --oneline --follow on the current path shows the only branch-side event is f0f1b2ae2a1 refactor: Move the WinRT project folder to src/Uno / c5cf7b5c32d refactor: Move Uno.UWP project folder to Uno.WinRT — a pure rename, no logic change.
Retarget task still writes the base name without disambiguating by extension.src/SourceGenerators/Uno.UI.Tasks/ResourceConverters/AndroidResourceConverter.cs:28 builds the physical file via AndroidResourceNameEncoder.EncodeDrawablePath(resourceCandidate.LogicalPath), and EncodeDrawablePath (src/Uno.WinRT/Helpers/AndroidResourceNameEncoder.cs:66-67) only encodes the directory/filename and appends the extension verbatim (encodedFileName + extension) — it does not fold the extension into the base name the way the issue's own suggested fix requires (e.g. Assets_Image_jpg.jpg), so two same-named, differently-extensioned assets in drawable/ still collide once Android resource compilation (aapt) keys by base name. This file is also unchanged vs. origin/master:src/Uno.UWP/Helpers/AndroidResourceNameEncoder.cs (diff returns no differences beyond the rename).
Not moot under Skia-only either.specs/050-breaking-changes-rollup/spec.md:241-243 lists this as unchecked BC74 ("Android drawable extension in retarget keys"), explicitly noting: "Deferred out of Phase 5: draft PR [BREAKING] fix!: Include original file extension in retargeted drawables on Android #15891 still targets master and is blocked on the nine-patch (.9.png) regression it exposes. Not moot under Skia-only — Skia-on-Android still resolves drawables through this path." DrawableHelper is confirmed live (not dead code): the source generator wires it at src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/AndroidResourcesGenerator.cs:80 (global::Uno.Helpers.DrawableHelper.SetDrawableResolver(...)), and it's also consumed by src/Uno.WinRT/Storage/StorageFile.Android.cs and src/Uno.WinRT/UI/StartScreen/Extensions/JumpListItemExtensions.Android.cs.
No migration-guide or PackageDiffIgnore entry — this is a bug fix, not an API removal, so neither is expected; a full-text grep -li for "drawable" across build/PackageDiffIgnore.xml and doc/articles/migrating-to-uno-7.md returns nothing, consistent with no behavior change having shipped.
The issue carries a no-repro label from an automated repro-generator pass, and a 2026 comment from Martin Zikmund ("This is still relevant for Skia Android") confirming it is neither stale nor obsolete.
Audit is code inspection against the branch worktree; no build or runtime validation was performed.
difficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/bugSomething isn't workinglow-hanging-🍒Categorizes an issue that might be a quick win with meaningful positive impact.no-reproplatform/android 🤖Categorizes an issue or PR as relevant to the Android platformproject/core-tools 🛠️Categorizes an issue or PR as relevant to core and tools
Activity
github-actions commentedon Aug 5, 2025
Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.
MartinZikmund commentedon Aug 5, 2025
This is still relevant for Skia Android
MartinZikmund commentedon Apr 8, 2026
Repro generator
This issue was classified as not reproducible with a code sample or test.
Reason: Android-specific asset naming bug.
[-][Android] Assets with the same name and different extension don't work properly[/-][+][Android] Assets with the same name and different extension don't work properly [7.0 ][/+][-][Android] Assets with the same name and different extension don't work properly [7.0 ][/-][+][Android] Assets with the same name and different extension don't work properly [7.0][/+]MartinZikmund commentedon Sep 2, 2026
Audit result: NOT STARTED in
feature/breakingchanges(as of0950717a0d7).The Android drawable key-collision bug the issue reports is unfixed on the branch — the lookup and retarget code are byte-identical to
origin/master, only relocated by the unrelatedUno.UWP→Uno.WinRTproject move. The fix exists as a stalled draft PR (#15891, targetsmaster, blocked on a nine-patch regression) and is tracked, unchecked, asBC74in the breaking-changes rollup.Remaining
src/Uno.WinRT/Helpers/DrawableHelper.Android.cs:48(FindResourceId) computes its lookup key viaAndroidResourceNameEncoder.Encode(System.IO.Path.GetFileNameWithoutExtension(imageName)), and:87(FindResourceIdFromPath) does the same viaPath.GetFileNameWithoutExtension(AndroidResourceNameEncoder.EncodeDrawablePath(imagePath))— extension is discarded either way, soImage.pngandImage.jpgstill resolve to the same key.diff <(git show origin/master:src/Uno.UWP/Helpers/DrawableHelper.Android.cs) src/Uno.WinRT/Helpers/DrawableHelper.Android.csreturns no differences;git log --oneline --followon the current path shows the only branch-side event isf0f1b2ae2a1 refactor: Move the WinRT project folder to src/Uno/c5cf7b5c32d refactor: Move Uno.UWP project folder to Uno.WinRT— a pure rename, no logic change.src/SourceGenerators/Uno.UI.Tasks/ResourceConverters/AndroidResourceConverter.cs:28builds the physical file viaAndroidResourceNameEncoder.EncodeDrawablePath(resourceCandidate.LogicalPath), andEncodeDrawablePath(src/Uno.WinRT/Helpers/AndroidResourceNameEncoder.cs:66-67) only encodes the directory/filename and appends the extension verbatim (encodedFileName + extension) — it does not fold the extension into the base name the way the issue's own suggested fix requires (e.g.Assets_Image_jpg.jpg), so two same-named, differently-extensioned assets indrawable/still collide once Android resource compilation (aapt) keys by base name. This file is also unchanged vs.origin/master:src/Uno.UWP/Helpers/AndroidResourceNameEncoder.cs(diffreturns no differences beyond the rename).gh pr view 15891→{"isDraft":true,"mergeCommit":null,"mergedAt":null,"state":"OPEN"}, targetingmaster(notfeature/breakingchanges), body reads "part of [SVG - Android] Failed to load SVG image - System.Xml.XmlException: Invalid character in the given encoding. #15866, closes [Android] Assets with the same name and different extension don't work properly [7.0] #9618".git merge-base --is-ancestoris moot since no merge commit exists to check.specs/050-breaking-changes-rollup/spec.md:241-243lists this as uncheckedBC74("Android drawable extension in retarget keys"), explicitly noting: "Deferred out of Phase 5: draft PR [BREAKING] fix!: Include original file extension in retargeted drawables on Android #15891 still targetsmasterand is blocked on the nine-patch (.9.png) regression it exposes. Not moot under Skia-only — Skia-on-Android still resolves drawables through this path."DrawableHelperis confirmed live (not dead code): the source generator wires it atsrc/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/AndroidResourcesGenerator.cs:80(global::Uno.Helpers.DrawableHelper.SetDrawableResolver(...)), and it's also consumed bysrc/Uno.WinRT/Storage/StorageFile.Android.csandsrc/Uno.WinRT/UI/StartScreen/Extensions/JumpListItemExtensions.Android.cs.PackageDiffIgnoreentry — this is a bug fix, not an API removal, so neither is expected; a full-textgrep -lifor "drawable" acrossbuild/PackageDiffIgnore.xmlanddoc/articles/migrating-to-uno-7.mdreturns nothing, consistent with no behavior change having shipped.Caveats (not blocking)
Assets_Image_jpg.jpg) — this is what [BREAKING] fix!: Include original file extension in retargeted drawables on Android #15891 implements, but its own regression (nine-patch.9.pnghandling) is the reason it never merged even tomaster, let alone this branch.no-reprolabel from an automated repro-generator pass, and a 2026 comment from Martin Zikmund ("This is still relevant for Skia Android") confirming it is neither stale nor obsolete.Audit is code inspection against the branch worktree; no build or runtime validation was performed.