Open janne-hmp opened 1 month ago
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!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Possibly related/duplicate #23268
I'm pretty sure this is related to the very unreliably working resizetizer on Android. Fonts are copied (for whatever reason) to obj/Debug/net9.0/resizetizer/f
directory and this seems to fail frequently along with many other resizetizer tasks on Android.
The workaround is not to use resizetizer with fonts on Android, but rather copy them to the right location using MauiAsset, as follows:
<MauiFont Include="Resources\Fonts\*" Condition="'$(TargetFramework)'!='net9.0-android'" />
<MauiAsset Include="Resources\Fonts\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" Condition="'$(TargetFramework)'=='net9.0-android'" />
This is happening in .NET 8.0 now also. It only happens on Debug mode, not Release for me.
Something has changed. This only started in the last few weeks for me.
Deleting bin and obj sometimes works. I have only had it happen ~5 times so I can't pin down what I'm doing if anything to trigger or fix it.
But I am not in .NET 9.0 so it is certainly not a .NET 9.0 only issue.
I am using
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.61" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.61" />
</ItemGroup>
Description
Randomly, when building a Maui app with Visual Studio in Windows, the Android version of Maui fails randomly to import the fonts, but still builds apparently fine. Other versions (iOS, Windows) seem to always build fine. This can be especially problematic with release builds going to Google Play Store if the fonts are left out of the package without any errors or warnings.
Steps to Reproduce
Not sure, since it happens very randomly, but still consistently every now and then.
Link to public reproduction project repository
https://github.com/hyvanmielenpelit/GnollHack
Version with bug
9.0.0-preview.4.10690
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
Android 14
Did you find any workaround?
Delete obj and bin directories and hope that the fonts are included next time when building.
Relevant log output
No response