Hey has anyone else seen this issue ?
I think its a timing issue on ESRI's API side between the navigation changed event and the dispose being called. My understanding is dispose() is probably freeing the memory in the native layer and nulling the reference in the jni layer.
My guess is even though I call removeNavigationChangedListener() first and then dispose(). The removeNavigationChangedListener might not be processing until after dispose() so when an event comes in due to timing this results in a NPE crash in jni since the coreGeoView is null by then.
Does this look like a possible hypothesis ?
Anyone what can be causing this crash, how to reproduce, or how to prevent it ?
We were only able to reproduce it once.
ESRI Android SDK version: 100.15.1
06-05 10:35:59.163 E/AndroidRuntime( 4650): FATAL EXCEPTION: main
06-05 10:35:59.163 E/AndroidRuntime( 4650): com.esri.arcgisruntime.ArcGISRuntimeException: Null pointer.: object cannot be null.
06-05 10:35:59.163 E/AndroidRuntime( 4650): at com.esri.arcgisruntime.internal.jni.CoreGeoView.nativeGetCurrentViewpoint(Native Method)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at com.esri.arcgisruntime.internal.jni.CoreGeoView.a(SourceFile:6)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at com.esri.arcgisruntime.internal.mapping.view.g.a(SourceFile:11)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at com.esri.arcgisruntime.mapping.view.GeoView.getCurrentViewpoint(SourceFile:1)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at navigationChangedEvent$lambda$3(MapViewManager.kt:72)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at com.*.map.views.MapViewManager.$r8$lambda$rVRzbl0bIqRbN635fKa6xg5_5oI(Unknown Source:0)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at com.*.map.views.MapViewManager$$ExternalSyntheticLambda3.navigationChanged(Unknown Source:2)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at com.esri.arcgisruntime.internal.mapping.view.t$a.run(SourceFile:1)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at android.os.Handler.handleCallback(Handler.java:938)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at android.os.Handler.dispatchMessage(Handler.java:99)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at android.os.Looper.loop(Looper.java:223)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at android.app.ActivityThread.main(ActivityThread.java:7725)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at java.lang.reflect.Method.invoke(Native Method)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
06-05 10:35:59.163 E/AndroidRuntime( 4650): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
06-05 10:35:59.305 I/am_crash( 1375): [4650,0,*,551042631,com.esri.arcgisruntime.ArcGISRuntimeException,Null pointer.,SourceFile,-2]