-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Copy font assets only works at second build #23268
Copy link
Copy link
Labels
area-fontsCustom fonts and Font related API'sCustom fonts and Font related API'sarea-single-projectSplash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, ResizetizerSplash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizerp/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area-fontsCustom fonts and Font related API'sCustom fonts and Font related API'sarea-single-projectSplash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, ResizetizerSplash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizerp/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Todo
Description
I wondered, why me IconFont was not working in release mode. The font is in Resources\Fonts\ folder referenced in .csproj:
I builded the app and deployed it to the simulator but no icon was shown. Hmm, in debug mode it works. So i looked in the obj folder. In Debug\net8.0-android\assets my ttf file was shown. In Release\net8.0-android\assets was no ttf file:


I started deleting obj/bin folders and rebuild. On the first build the assets folder keeps empty but with the second build the folder contains the ttf files and my icon font starts working in release mode:
The screenshots shows the default MAUI App with the included fonts. The behavior is the same.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
8.0.60 SR6
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