3
\$\begingroup\$

Today I struggled with the problem that appears on building my Monogame Android game with Release option. On Debug, everything is OK, but for some reason my game crashes on launch with Release build.

There is a message from Device Logcat:

android.runtime.JavaProxyThrowable: [Microsoft.Xna.Framework.Content.ContentLoadException]: Could not find ContentTypeReader Type. Please ensure the name of the assembly that contains the Type matches the assembly in the full type name.

It doesn't run either on emulator or my real phone. Also, I have signed my apk.

Maybe there's a mistake in my project settings?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

Found a solution here: trimming-linker-breaks-spritefont-loading

Create an XML file TrimmerRoots.xml in your project with this content:

<linker>
    <assembly fullname="System.Private.CoreLib" preserve="all" />
    <assembly fullname="mscorlib" preserve="all" />
</linker>

Then edit your .csproj file and add a reference to an XML file:

<ItemGroup>
    <TrimmerRootDescriptor Include="TrimmerRoots.xml" />
</ItemGroup>
\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .