This can be easily reproduced by creating a new Android project (MonoGame 3.8.1.303, .NET6, Android 31), though I have the same issue with iOS. Add a new SpriteFont to your content (default Arial template is fine), and then try to build a release build (or enable the trimmer/linker on a debug build to actually see the error).
It will crash when attempting to load the SpriteFont with Could not find ContentTypeReader Type
I have tried to set the trim mode to SDK Only. I have tried to add a RootAssembly directive for MonoGame.Framework. I’ve also attempted it for Microsoft.Xna.Framework.Content.ContentTypeReader as I had read in another thread, but that errors out saying it cannot be found.
The only way I’ve been able to build my mobile builds is by disabling the trimmer/linker entirely.
I believe I’ve found a solution for this. After ripping into the SpriteFont’s XNB, I discovered that the MG content loader uses System.Char by reflection when loading SpriteFonts. So, stop the linker from removing it. I tried a couple methods to only block the trimming of the System.Char type without luck. I would be interested if anyone else is doing this a bit cleaner. Here’s what you can do:
Create an XML file (ex: TrimmerRoots.xml) with this content: