enisn / UraniumUI

Uranium is a Free & Open-Source UI Kit for MAUI.
Apache License 2.0
1.16k stars 137 forks source link

Font asset not found /data/user/0/.../cache/MaterialSymbolsSharp.ttf #744

Open kaniosm opened 2 months ago

kaniosm commented 2 months ago

I keep getting the following warning with Material Symbols:

"Font asset not found /data/user/0/.../cache/MaterialSymbolsSharp.ttf"

NiX3r commented 2 months ago

Did you initialized in MauiProgram?

NiX3r commented 2 months ago

I'm referencing to this: https://enisn-projects.io/docs/en/uranium/latest/theming/Icons#material-symbols

kaniosm commented 2 months ago

Hi ,

Yes, I'm referencing both Material and FontAwasome at startup.

.ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); fonts.AddFont("Inter.ttf", "Inter"); fonts.AddMaterialSymbolsFonts(); fonts.AddFontAwesomeIconFonts(); })

NiX3r commented 2 months ago

Your error seems like on Android. Does this error appear on Windows/Linux/iOS either?

kaniosm commented 2 months ago

No, only on Adnroid, and it happens for both MaterialSymbols and FontAwesome

enisn commented 2 months ago

Hi, I reproduced this issue in a couple of days ago. It might be related to Embedded Resource logic in libraries. When I face this log, everything was working as expected but there was only logs in the console.

https://github.com/enisn/UraniumUI/blob/101ae50b32a1b3fc248efb24ff91796484b7c221/src/UraniumUI.Icons.MaterialSymbols/UraniumUI.Icons.MaterialSymbols.csproj#L29

Probably, MAUI copies fonts into apk, msix or whatever you use, and use them as extracted version. But still, I try to access them from DLL as embedded resource.

I'll check about what can I do

kaniosm commented 2 months ago

Hi Enis,

Yes, I can confirm that the fonts still load and this is only coming as a warning in the logs. It happens very often though and I'm not sure what's the performance impact.

I think this has to do with the way the resource is loaded and possibly there is a retry looking for a different path.

Thx for considering!

YBTopaz8 commented 2 weeks ago

I do have this or a version of this Java.Lang.RuntimeException: Font asset not found data/user/0/com.yvanbrunel.dimmermaui/cache/MaterialIconsRound-Regular.otf The app works in Debug but doesn't work in release, unsure if this is the cause but it's one of the exceptions