Fatal Exception: com.esri.arcgisruntime.ArcGISRuntimeException

2586
4
07-02-2020 04:15 AM
ShylendraMadda
New Contributor
I am using ESRI map in my Android app with
esriMapVersion = '100.8.0' 
The app is crashing due to this error, I don't know why it is happening. May I know the reason for this?
Fatal Exception: com.esri.arcgisruntime.ArcGISRuntimeException: Null pointer
       at com.esri.arcgisruntime.internal.jni.CoreMapView.nativeGetMagnifierEnabled(CoreMapView.java)
       at com.esri.arcgisruntime.internal.jni.CoreMapView.r(CoreMapView.java:190)
       at com.esri.arcgisruntime.internal.h.b.p.t(p.java:304)
       at com.esri.arcgisruntime.mapping.view.MapView.isMagnifierEnabled(MapView.java:397)
       at com.esri.arcgisruntime.mapping.view.DefaultMapViewOnTouchListener.onLongPress(DefaultMapViewOnTouchListener.java:659)
       at com.esri.arcgisruntime.mapping.view.DefaultMapViewOnTouchListener$2.run(DefaultMapViewOnTouchListener.java:176)
       at android.os.Handler.handleCallback(Handler.java:873)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7080)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

More info:

Fatal Exception: com.esri.arcgisruntime.ArcGISRuntimeException: Null pointer
       at com.esri.arcgisruntime.internal.jni.CoreGeoView.nativePause(CoreGeoView.java)
       at com.esri.arcgisruntime.internal.jni.CoreGeoView.a(CoreGeoView.java:575)
       at com.esri.arcgisruntime.internal.h.b.g.c(g.java:1058)
       at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.b(GeoView.java:1175)
       at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.lambda$4H6K_b9I57wxvILOLXOzXwoSpac(GeoView.java)
       at com.esri.arcgisruntime.mapping.view.-$$Lambda$GeoView$RenderingThread$BRrsZ2XB9Y4rOvLRx6U82gkIAIs.run(-.java:2)
       at android.os.Handler.handleCallback(Handler.java:873)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:214)
       at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.run(GeoView.java:1210)

Let me know if need any further info. Thanks in advance.

0 Kudos
4 Replies
NandKishore
New Contributor II

We are seeing a similar crash after migrating to 100.8 ArcGIS:

07-04 01:27:36.273 13638 13719 E AndroidRuntime: FATAL EXCEPTION: Rendering thread
07-04 01:27:36.273 13638 13719 E AndroidRuntime: Process: com.our.application, PID: 13638
07-04 01:27:36.273 13638 13719 E AndroidRuntime: com.esri.arcgisruntime.ArcGISRuntimeException: Null pointer: object cannot be null.
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at com.esri.arcgisruntime.internal.jni.CoreGeoView.nativePause(Native Method)
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at com.esri.arcgisruntime.internal.jni.CoreGeoView.a(SourceFile:575)
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at com.esri.arcgisruntime.internal.h.b.g.c(SourceFile:1058)
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.b(SourceFile:1175)
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.lambda$BRrsZ2XB9Y4rOvLRx6U82gkIAIs(Unknown Source:0)
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at com.esri.arcgisruntime.mapping.view.-$$Lambda$GeoView$RenderingThread$BRrsZ2XB9Y4rOvLRx6U82gkIAIs.run(Unknown Source:2)
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:883)
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100)
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at android.os.Looper.loop(Looper.java:237)
07-04 01:27:36.273 13638 13719 E AndroidRuntime: at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.run(SourceFile:1210)
07-04 01:27:36.274 5825 5947 D ViewRootImpl@458289e[map]: dispatchDetachedFromWindow

Edit: We realised this crash appears from our Activity's onDestroy() when we have called  MapView.dispose() (From the GeoView class's

RenderingThread's dispose() method)

As this exception occurs in a different thread, we are unable to catch this exception. 

Any ideas what causes this crash?

0 Kudos
GuntherHeppner
Esri Contributor

Hi Nand,

Would you be able to share some simplified reproducer code and steps with us?

Thanks, Gunther

0 Kudos
NandKishore
New Contributor II

Hi Gunther,

Our Application is quite big. If you ask any particular API call we are making, I could provide.

Actual code which is causing the exception is as below:

@Override
protected void onDestroy() {
super.onDestroy();
LOGGER.warn(" AbstractMapContainingActivity: onDestroy ");
mMapView.getMapView().dispose();
mIDPEventsRenderingManager.terminate();
mWrappingOnLocationChangeListener.removeLocationListener(mMapLocationListener);
mConnectionRestoredListener.unregisterConnectionStatusChangedListener(mCurrentDeviceHidingPlugin);
mConnectionRestoredListener.unregisterConnectionStatusChangedListener(this);
mGraphicsServiceConnection.safelyUnbindService();
}

This is the line which leads to the crash:

07-08 17:21:55.821 2741 2797 I TextureView: RenderingThread - Disposing started
07-08 17:21:55.824 2741 2797 E AndroidRuntime: FATAL EXCEPTION: Rendering thread
07-08 17:21:55.824 2741 2797 E AndroidRuntime: Process: com.example.map, PID: 2741
07-08 17:21:55.824 2741 2797 E AndroidRuntime: com.esri.arcgisruntime.ArcGISRuntimeException: Null pointer: object cannot be null.
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at com.esri.arcgisruntime.internal.jni.CoreGeoView.nativePause(Native Method)
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at com.esri.arcgisruntime.internal.jni.CoreGeoView.a(SourceFile:575)
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at com.esri.arcgisruntime.internal.h.b.g.c(SourceFile:1058)
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.b(SourceFile:1175)
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.lambda$BRrsZ2XB9Y4rOvLRx6U82gkIAIs(Unknown Source:0)
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at com.esri.arcgisruntime.mapping.view.-$$Lambda$GeoView$RenderingThread$BRrsZ2XB9Y4rOvLRx6U82gkIAIs.run(Unknown Source:2)
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:883)
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100)
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
07-08 17:21:55.824 2741 2797 E AndroidRuntime: at com.esri.arcgisruntime.mapping.view.GeoView$RenderingThread.run(SourceFile:1210)
07-08 17:21:55.827 1342 3651 W ActivityTaskManager: Force finishing activity com.example.map/com.example.mapping.ICEHandlingMappingActivity

Please note that same code works fine when we use 100.5 library.

As we are migrating to Android10 (100.5 is not compatible with Android10), we have to move to 100.8 ArcGIS.

We doubt that this exception happends in 100.8 as it has started using TextureView. 

Please note the first line before the crash:

07-08 17:21:55.821 2741 2797 I TextureView: RenderingThread - Disposing started

 

Let me know if you need any particular information from our code.

Thank you.

0 Kudos
NandKishore
New Contributor II

We started using 100.7 ArcGIS version as we couldn't resolve this issue.

0 Kudos