Hi all. I recently published a MonoGame app for Android. I have so far had about 30 instances of a crash raised at AndroidCompatibility.GetDeviceNaturalOrientation:
android.runtime.JavaProxyThrowable: at Microsoft.Xna.Framework.AndroidCompatibility.GetDeviceNaturalOrientation () [0x0003a] in <9ada205e34c24069b86951f48cabfc87>:0
at System.Lazy`1[T].ViaFactory (System.Threading.LazyThreadSafetyMode mode) [0x00043] in <8289a1ff45694655b38833c04d9f9260>:0
at System.Lazy`1[T].ExecutionAndPublication (System.LazyHelper executionAndPublication, System.Boolean useDefaultConstructor) [0x00022] in <8289a1ff45694655b38833c04d9f9260>:0
at System.Lazy`1[T].CreateValue () [0x00074] in <8289a1ff45694655b38833c04d9f9260>:0
at System.Lazy`1[T].get_Value () [0x0000a] in <8289a1ff45694655b38833c04d9f9260>:0
at Microsoft.Xna.Framework.AndroidGameActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x0000b] in <9ada205e34c24069b86951f48cabfc87>:0
at Bop.DescensusMono.Android.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00000] in <4bbbdf8efa5840398d5cb87c138e7008>:0
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x0000f] in <439d9f7cae8f4049a5e18e4cc2cc6e02>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.1(intptr,intptr,intptr)
This happens across a variety of newish phones and Android versions from 9 to 11.
The MainActivity class defines these properties on its “Activity” attribute:
ScreenOrientation = ScreenOrientation.FullSensor,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
Has anyone seen this behaviour before?
Many thanks!
Tom