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

[Android] AddEmbeddedResourceFont Shows Exception Warning in Output Window #24059

Open
BrundhaVelusamy opened this issue Aug 7, 2024 · 5 comments
Labels
area-fonts Custom fonts and Font related API's platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@BrundhaVelusamy
Copy link

Description

Description:

When registering a custom font as an embedded resource in a MAUI project, the following error appears in the output window when deploying on Android:

java.lang.RuntimeException: Font asset not found /data/user/0/com.companyname.mauisampleapplication/cache/Maui Material Assets.ttf

Reference sample:
MauiSampleApplication.zip

Steps to Reproduce

  1. Create the simple Maui application.
  2. Include the custom font file in the resource.
  3. Register the font file as embedded resource.
  4. Run the sample on Android.
  5. The mentioned warning will shown on the output window.

Link to public reproduction project repository

No response

Version with bug

8.0.71 SR7.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@BrundhaVelusamy BrundhaVelusamy added the t/bug Something isn't working label Aug 7, 2024
Copy link
Contributor

github-actions bot commented Aug 7, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@RoiChen001 RoiChen001 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed platform/android 🤖 labels Aug 7, 2024
@RoiChen001
Copy link

I can repro this issue at Android platform on the latest 17.11.0 Preview 6.0 (8.0.71 & 8.0.70).

@spreedated
Copy link

Also here to confirm the issue on the latest MAUI, compiled against net8.0-android34.0.

@samhouts samhouts added the area-fonts Custom fonts and Font related API's label Aug 27, 2024
@superwilly1
Copy link

superwilly1 commented Sep 25, 2024

When debugging the provided MauiSampleApplication solution on Android, I also see output messages about the fonts (not just Maui Material Assets.ttf but also OpenSans-Regular.ttf).

Messages in the output window:
Java.Lang.RuntimeException: Font asset not found /data/user/0/com.companyname.mauisampleapplication/cache/Maui Material Assets.ttf
And:
Java.Lang.RuntimeException: Font asset not found OpenSans-Regular.ttf

But the app just runs and shows the correct fonts.
Also the release version seems to work without crashing.

My issue is, that we are using a 3rd party control (via a nuget package) that uses an embedded font.
Debug works, but the release version crashes (on some Android devices, not all) with the same messages as above, only then as fatal exceptions:
Abort message: '[ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.RuntimeException: Font asset not found /data/user/0/<ApplicationId>/cache/Maui Material Assets.ttf
and:
Abort message: '[ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.RuntimeException: Font asset not found OpenSansRegular

So our issue is: using a nuget package that contains an embedded font crashes the release version of the app on some Android devices.
The app starts up correct, but then whenever the fonts are being used, the app crashes.

@BrundhaVelusamy
Copy link
Author

Please provide a high priority for the resolution of this issue.

Relevant issue: #19804

@jsuarezruiz jsuarezruiz added this to the Backlog milestone Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-fonts Custom fonts and Font related API's platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants