App crashes on relaunch when android back button is pressed

We have the Sfmaps control within a navigation page in a xamarin forms application. Using the android back button from the map page closes the application and causes a crash when the app relaunches.


Steps:
  1. Place sfmap control in xamarin forms navigation page
  2. Launch app on android device and navigate to above map page
  3. Press android "back" button. App should close at this point
  4. Relaunch application. App crashes with the following exception:

05-25 09:09:10.050 I/MonoDroid( 5350): UNHANDLED EXCEPTION:
05-25 09:09:10.074 I/MonoDroid( 5350): System.ObjectDisposedException: Cannot access a disposed object.
05-25 09:09:10.074 I/MonoDroid( 5350): Object name: 'Com.Syncfusion.Maps.MapElementsRenderer'.
05-25 09:09:10.074 I/MonoDroid( 5350):   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <09bf3e262b934ffab2ba01f9fc7fd54d>:0 
05-25 09:09:10.074 I/MonoDroid( 5350):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <09bf3e262b934ffab2ba01f9fc7fd54d>:0 
05-25 09:09:10.074 I/MonoDroid( 5350):   at Android.Views.View.Invalidate () [0x0000a] in <25661073a35344a89f215a4cf81af37c>:0 
05-25 09:09:10.074 I/MonoDroid( 5350):   at Com.Syncfusion.Maps.ShapeFileLayer.GenerateMarkers () [0x000bf] in <43ec7b859d554c0591db1721b5f73b3b>:0 
05-25 09:09:10.074 I/MonoDroid( 5350):   at Com.Syncfusion.Maps.SfMaps.Refresh () [0x000ae] in <43ec7b859d554c0591db1721b5f73b3b>:0 
05-25 09:09:10.074 I/MonoDroid( 5350):   at Com.Syncfusion.Maps.ShapeFileLayer.set_DataSource (System.Object value) [0x00030] in <43ec7b859d554c0591db1721b5f73b3b>:0 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Syncfusion.SfMaps.XForms.Droid.ShapeFileLayerMapping.OnShapeFileLayerPropertiesChanged (System.String propertyName, Syncfusion.SfMaps.XForms.ShapeFileLayer formLayer, Com.Syncfusion.Maps.ShapeFileLayer nativeLayer) [0x000e3] in <b85c48f7f8774410a6fb100d30c78d07>:0 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Syncfusion.SfMaps.XForms.Droid.ShapeFileLayerMapping.Level_PropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00026] in <b85c48f7f8774410a6fb100d30c78d07>:0 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x0000a] in D:\agent_work\1\s\Xamarin.Forms.Core\BindableObject.cs:146 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00107] in D:\agent_work\1\s\Xamarin.Forms.Core\BindableObject.cs:602 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\agent_work\1\s\Xamarin.Forms.Core\BindableObject.cs:399 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in D:\agent_work\1\s\Xamarin.Forms.Core\BindingExpression.cs:174 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in D:\agent_work\1\s\Xamarin.Forms.Core\BindingExpression.cs:56 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in D:\agent_work\1\s\Xamarin.Forms.Core\BindingExpression.cs:547 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <25661073a35344a89f215a4cf81af37c>:0 
05-25 09:09:10.075 I/MonoDroid( 5350):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <25661073a35344a89f215a4cf81af37c>:0 
05-25 09:09:10.075 I/MonoDroid( 5350):   at (wrapper dynamic-method) System.Object.12c6207b-3af2-43fd-af1e-ba38f7c15540(intptr,intptr)

1 Reply

SG Sri Gayathri Gopalakrishnan Syncfusion Team May 28, 2018 12:26 PM UTC

Hi Andrew, 
 
We have analyzed your query, we were unable to reproduce your scenario but based on the given callstack, NullReferenceException issue has been reproduced and fixed. This fix will be included in our upcoming vol 2sp1 release which is expected to be rolled out by the end of June 2018.  
 
Regards, 
Sri Gayathri. G 


Loader.
Up arrow icon