Android Release build can't find ContentTypeReader

When running a debug build the app runs fine in the emulator but when I switch to a release build, in order to check how it runs on a physical device, it crashes both on the emulator and on the physical device. here is the error:

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: Microsoft.Xna.Framework.Content.ListReader1[[System.Char, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] (Microsoft.Xna.Framework.Content.ListReader1[[System.Char, mscorlib]])
at Microsoft.Xna.Framework.MonoGameAndroidGameView.UpdateAndRenderFrame()
at Microsoft.Xna.Framework.MonoGameAndroidGameView.processStateRunning(CancellationToken token)
at Microsoft.Xna.Framework.MonoGameAndroidGameView.RunIteration(CancellationToken token)
at Microsoft.Xna.Framework.MonoGameAndroidGameView.<>c__DisplayClass62_0.b__0(Object s)
at Android.App.SyncContext.<>c__DisplayClass3_0.b__0()
at Java.Lang.Thread.RunnableImplementor.Run()
at Java.Lang.IRunnableInvoker.n_Run(IntPtr , IntPtr )
at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(_JniMarshal_PP_V , IntPtr , IntPtr )
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

This is very similar to this topic ([SOLVED] ContentLoadException in version 3.7.0.1232), however the difference is I am loading a PNG which it tries to use the Texture importer. I tried the FBX importer, because why not :slight_smile: but that won’t even compile then.

I am using monogame 3.8.1.303

thanks for any advice

The trimmer is removing mscorlib because it is used via reflection. Solution:

1 Like

That worked perfectly, thanks

1 Like