unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.92k stars 723 forks source link

[Android][iOS] Image Asset Named with ISO Code doesn't Work #9264

Open Soap-141 opened 2 years ago

Soap-141 commented 2 years ago

Current behavior

When an image asset is named with an ISO code representing a language the image doesn't work on Android and iOS.

For example: image_bg.png.

The image on the left is named Doge.png and the Image on the right is named Doge_bg.png.

UWP: Capture_76

Android: Capture_75

Expected behavior

The image should work properly.

How to reproduce it (as minimally and precisely as possible)

  1. Download SampleImg.zip
  2. Open the solution in Visual Studio
  3. Start the application in UWP
  4. Notice two images
  5. Start the application on Android or iOS
  6. Notice only one image

Workaround

Rename the image asset.

Example: Doge_bg.png would not work but Doge.png would work.

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia, Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

Uno 4.4.13 & 4.5.0-dev.222

Affected platforms

iOS, Android

IDE

Visual Studio 2022

IDE version

17.2.6

Relevant plugins

No response

Anything else we need to know?

I did not test on other platforms.

jeromelaban commented 2 years ago

This is likely related to https://github.com/unoplatform/uno/issues/7431

MartinZikmund commented 1 year ago

Related issue:

Related to https://github.com/unoplatform/nventive-private/issues/404

Current behavior

Images that use CA without letters beside it, do not appear

Expected behavior

Images should appear

How to reproduce it (as precisely as possible)

Open the app

Sample: ImageDisplayPath.zip

Output Debug: Uno.Helpers.DrawableHelper[0] Couldn't find drawable with key: CA Uno.Helpers.DrawableHelper[0] Couldn't find drawable with key: CA Uno.Helpers.DrawableHelper[0] Couldn't find drawable with key: ca_Flag Uno.Helpers.DrawableHelper[0] Couldn't find drawable with key: ca_Flag

[ImageView] Unable to find resource: 2131165184 [ImageView] android.content.res.Resources$NotFoundException: Resource ID #0x7f070000 [ImageView] at crc64122dcf5ad656876d.FrameworkElement.06-14 14:51:01.340 W/ImageView( 4267): at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:234) [ImageView] at android.content.res.Resources.getDrawableForDensity(Resources.java:982)

yeahg-dev commented 4 months ago

image file name containing "mic" also does not rendering.