System.ObjectDisposedException: Cannot access a disposed object.

Hi, I've been looking solution for SfImageEditor Android, whenever I am opening editor, save, finish activity for the first time, seems no problem.
However if i am doing exact same thing for the second time, open editor (start sfImageEditorActivity), it crashes with this exception "System.ObjectDisposedException".
I know this is not only my problem since your SampleCode from dev essentials also behaves the same way, it crashes on the second time trying to load image.

my visual studio version is 15.4.4,
sdk for compilation is API level 26
target platform mono 8.0
syncfusion SfImageEditor version 15.4.0.17.

thank you in advance.

debug information:

11-29 17:42:02.202 E/mono    (31446):
11-29 17:42:02.202 E/mono    (31446): Unhandled Exception:
11-29 17:42:02.202 E/mono    (31446): System.ObjectDisposedException: Cannot access a disposed object.
11-29 17:42:02.202 E/mono    (31446): Object name: 'Android.Graphics.Bitmap'.
11-29 17:42:02.202 E/mono    (31446):   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <7cfbebb561c54efc9010b018c0846c7e>:0
11-29 17:42:02.202 E/mono    (31446):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeAbstractVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <7cfbebb561c54efc9010b018c0846c7e>:0
11-29 17:42:02.202 E/mono    (31446):   at Android.Graphics.Bitmap.Recycle () [0x0000a] in :0
11-29 17:42:02.202 E/mono    (31446):   at Syncfusion.SfImageEditor.Android.SfImageEditor.ReleaseBitmaps () [0x00026] in <94e54f7aa6304c908898b61fc4e8a06d>:0
11-29 17:42:02.202 E/mono    (31446):   at Syncfusion.SfImageEditor.Android.SfImageEditor.Dispose (System.Boolean disposing) [0x00007] in <94e54f7aa6304c908898b61fc4e8a06d>:0
11-29 17:42:02.202 E/mono    (31446):   at Java.Lang.Object.Finalize () [0x00048] in :0
11-29 17:42:02.212 E/mono-rt (31446): [ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object.
11-29 17:42:02.212 E/mono-rt (31446): Object name: 'Android.Graphics.Bitmap'.
11-29 17:42:02.212 E/mono-rt (31446):   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <7cfbebb561c54efc9010b018c0846c7e>:0
11-29 17:42:02.212 E/mono-rt (31446):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeAbstractVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <7cfbebb561c54efc9010b018c0846c7e>:0
11-29 17:42:02.212 E/mono-rt (31446):   at Android.Graphics.Bitmap.Recycle () [0x0000a] in :0
11-29 17:42:02.212 E/mono-rt (31446):   at Syncfusion.SfImageEditor.Android.SfImageEditor.ReleaseBitmaps () [0x00026] in <94e54f7aa6304c908898b61fc4e8a06d>:0
11-29 17:42:02.212 E/mono-rt (31446):   at Syncfusion.SfImageEditor.Android.SfImageEditor.Dispose (System.Boolean disposing) [0x00007] in <94e54f7aa6304c908898b61fc4e8a06d>:0
11-29 17:42:02.212 E/mono-rt (31446):   at Java.Lang.Object.Finalize () [0x00048] in :0

3 Replies

AK Ashwin Kumaravel Syncfusion Team November 30, 2017 06:56 AM UTC

Hi Firdaus,

Thanks for using Syncfusion products.

We could reproduce the reported issue “Cannot access a disposed object” at our end. We have logged a defect report regarding the same and already you have created a support ticket for this issue.

Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/  

Regards,
Ashwin


YZ Yun Zhou February 26, 2018 11:03 PM UTC

Hi there,
Is there any update on this issue?
I am also having same issue when switch between activities using sfchart in Xamarin.Android project.
I also found a similar question in below ticket:
https://www.syncfusion.com/forums/130645/application-crashes-unexpectedly

Thanks
Yun


DV Divya Venkatesan Syncfusion Team February 27, 2018 02:27 PM UTC

Hi Yun,

We have fixed the UnhandledException caused by accessing the disposed object in our 2018 Volume 1 release, please upgrade your SfChart to 16.1.0.24 version and check whether your issue is resolved. If you could still reproduce the issue, please provide us your call stack details which would be helpful for us to investigate further.

https://www.syncfusion.com/forums/136049/essential-studio-2018-volume-1-release-v16-1-0-24-is-available-for-download  

You can also obtain the latest version of SfChart package from nuget.org.
https://www.nuget.org/packages/Syncfusion.Xamarin.SfChart/  

Regards,
Divya Venkatesan


Loader.
Up arrow icon