Can someone please help me with this exception? This has been the most prevalent exception that my users are reporting. Unfortunately I cannot see my own functions on the stack, so I am not sure when exactly this exception is being thrown, but the stack trace clearly points to here:
Texture2D.OpenGL.cs
at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.GetGLFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat format, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice, OpenTK.Graphics.ES20.PixelInternalFormat& glInternalFormat, OpenTK.Graphics.ES20.PixelFormat& glFormat, OpenTK.Graphics.ES20.PixelType& glType) [0x00016] in <b7e9ca9b854342788f9c3f1fe6a85940>:0
at Microsoft.Xna.Framework.Graphics.Texture2D+<>c__DisplayClass4.<PlatformConstruct>b__3 () [0x00022] in <b7e9ca9b854342788f9c3f1fe6a85940>:0
at Microsoft.Xna.Framework.Threading+<>c__DisplayClass1.<BlockOnUIThread>b__0 () [0x00019] in <b7e9ca9b854342788f9c3f1fe6a85940>:0
at Microsoft.Xna.Framework.Threading.Run () [0x0002a] in <b7e9ca9b854342788f9c3f1fe6a85940>:0
at Microsoft.Xna.Framework.AndroidGameWindow.OnUpdateFrame (System.Object sender, OpenTK.FrameEventArgs frameEventArgs) [0x0001d] in <b7e9ca9b854342788f9c3f1fe6a85940>:0
at OpenTK.GameViewBase.OnUpdateFrame (OpenTK.FrameEventArgs e) [0x00008] in <6433d329f6e64906a106a236da189b21>:0
at OpenTK.Platform.Android.AndroidGameView.UpdateFrameInternal (OpenTK.FrameEventArgs e) [0x00009] in <6433d329f6e64906a106a236da189b21>:0
at OpenTK.Platform.Android.AndroidGameView.RunIteration (System.Threading.CancellationToken token) [0x00073] in <6433d329f6e64906a106a236da189b21>:0
at OpenTK.Platform.Android.AndroidGameView+<>c__DisplayClass59_0.<StartThread>b__1 (System.Object _) [0x00000] in <6433d329f6e64906a106a236da189b21>:0
at Android.App.SyncContext+<>c__DisplayClass3_0.<Send>b__0 () [0x00000] in <9ec3ae1a7f2047bb998fba5653773f44>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <9ec3ae1a7f2047bb998fba5653773f44>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <9ec3ae1a7f2047bb998fba5653773f44>:0
at (wrapper dynamic-method) System.Object:85f6d720-a3f9-4cce-99a3-9c9d69d27195 (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:739) at android.os.Handler.dispatchMessage (Handler.java:95) at android.os.Looper.loop (Looper.java:145) at android.app.ActivityThread.main (ActivityThread.java:5942) at java.lang.reflect.Method.invoke (Native Method) at java.lang.reflect.Method.invoke (Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1400) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1195)
What should I do to my code to sanitize it? Do I have to wrap all Content.Load() calls into a try/catch? And how should I handle the above exception should it occur?