Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kaniosm opened this issue Aug 21, 2024 · 8 comments
Open
Labels
bug-report Potential bug that should be verified core-fonticons

Comments

@kaniosm
Copy link

kaniosm commented Aug 21, 2024

I keep getting the following warning with Material Symbols:

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

@NiX3r
Copy link

NiX3r commented Aug 26, 2024

Did you initialized in MauiProgram?

@NiX3r
Copy link

NiX3r commented Aug 26, 2024

@kaniosm
Copy link
Author

kaniosm commented Aug 26, 2024

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
Copy link

NiX3r commented Aug 26, 2024

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

@kaniosm
Copy link
Author

kaniosm commented Aug 26, 2024

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

@enisn enisn added bug-report Potential bug that should be verified core-fonticons labels Aug 26, 2024
@enisn
Copy link
Owner

enisn commented Aug 26, 2024

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.

<EmbeddedResource Include="Resources\Fonts\*" />

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
Copy link
Author

kaniosm commented Aug 26, 2024

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Potential bug that should be verified core-fonticons
Projects
None yet
Development

No branches or pull requests

4 participants