EDIT: not all Android users experience it, and it doesn't happen on every startup, it occurs once in a while
Hi, this exception is from a MAUI 10.0.70 app using ArcGIS Maps SDK 300.0.0.
Many of our Android users experience this one, and it happens at app startup. Well before any IWindowManagerInvoker is expected to be disposed of.
The app initializes MapView.LocationDisplay on startup with default data source. Initialization happens at MapView.Loaded event.
android.runtime.JavaProxyThrowable: [System.ObjectDisposedException]: Cannot access disposed object with JniIdentityHashCode=48158090.
Object name: 'Android.Views.IWindowManagerInvoker'.
at Android.Views.IWindowManagerInvoker.get_DefaultDisplay + 0x0(Unknown Source)
at Esri.ArcGISRuntime.Location.AndroidCompassProvider.Android.Hardware.ISensorEventListener.OnSensorChanged + 0x0(Unknown Source)
at Android.Hardware.ISensorEventListenerInvoker.n_OnSensorChanged_Landroid_hardware_SensorEvent_ + 0x0(Unknown Source)
at crc64f261feee1d215ead.AndroidCompassProvider.n_onSensorChanged(Native Method)
at crc64f261feee1d215ead.AndroidCompassProvider.onSensorChanged(AndroidCompassProvider.java:37)
at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:1203)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.nextLegacy(MessageQueue.java:985)
at android.os.MessageQueue.next(MessageQueue.java:1094)
at android.os.Looper.loopOnce(Looper.java:222)
at android.os.Looper.loop(Looper.java:392)
at android.app.ActivityThread.main(ActivityThread.java:10346)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:638)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:972)
PS: Would it be an idea to wrap the compass provider code (and similar code) in try/catch to avoid tearing down the whole app? Or perhaps route the exception through a mechanism akin to TaskScheduler.UnobservedTaskException and possibility to use SetObserved().