-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android 7.1.2 - System.ObjectDisposedException: Cannot access a disposed object. #157
Comments
UPDATE: Well, I see, that above HockeyApp stacktrace didn't mention anywhere about Rg.Plugins.Popup... however I'm 100% sure, that there were Rg.Plugins.Popup.Droid..something in stacktrace of Visual Studio debug, but I haven't copied it :x. Will try to reproduce it again, but it's really hard to do this. |
Just reproduce it again.
|
@Szymaniuk Hi. Tell me what version of plugin do you use? Did you try to use 1.1.0-pre2? |
@rotorgames Yes, 1.1.0-pre2 |
Still the same using 1.1.0-pre3 + even latest pre-release of XF 2.5.0.19271-pre2:
Whole stack-trace from hockeyapp:
|
I've just temporarly workarounded it, by wrapping your DispatchTouchEvent implementation:
I know, it's not a solution, but at least the whole app is not crashing. |
I think that I resolved this problem. You can test it from the development NuGet: https://ci.appveyor.com/nuget/rg-plugins-popup-p6l5elugev99 Not afraid to reopen this issue if you have this problem again. Thanks. |
I believe I am seeing the same issue. It happens on a variety of devices and OS versions. I'm using 1.1.4.154-pre, and I didn't see this issue prior to the update (previously using 1.0.4)
|
@kpespisa Ok I will review it |
@kpespisa I get exactly the same exception on Samsung devices. I get the exception when I call: plugin version: 1.1.4.168 |
I am getting this error with latest version. My popup contains an Editor control which would be focused at time of closing popup. Which leads me to believe it must be caused by something around this line:
|
Actually the below doesn't work - it doesnt load the renderer as suggested by @Szymaniuk this is a temp fix for the issue:
|
I just had the same issue on Samsung Xcover 4. In the office we had three identical Xcovers and the error happend only on one of them (but every time). Turned out it was because power saving turned on. Turning off power saving fixed the issue, and turning it on on device that previously worked was introducing the crash. So it's most probably something that Samsung's power saving changes, that causes the popup to be disposed too soon. I also checked on Samsung S8 and Xcover 3. Everytime same story: works ok without power saving, crashes with it. |
@Episodex I have the same problem with Samsung Galaxy A5 and Rg.Plugins.Popup 1.1.14.168 (for now its the latest version). It was working on emulator but not on the real device. After I saw your comment, I realize that the power saving turned on and I made it off and it works.. Well I executed my code as : Device.BeginInvokeOnMainThread(async () => await PopupNavigation.Instance.PopAsync()); and it works |
I hope that I fixed it in the last version of the plugin which is available in the development nuget right now. All navigation is invoked in the main thread in the last release whatever how navigation has been invoked in the user's code. I will be happy if someone can test it with the last version of the plugin >= 1.1.5.184. Thanks. |
Unfortunatelly it still crashes on Android:
|
i got the same error |
Should this issue be re-opened if people are still seeing it? |
Can anyone give me exactly the line's number of the exception? Or can somebody replicate it stable? |
Ok, guys. I did some changes in Android's Renderer. Please, test the last version in Development NuGet: https://ci.appveyor.com/nuget/rg-plugins-popup-p6l5elugev99 (1.1.5.209+) and let me know about results. Thanks. |
Hey - any news if the dev release fixed the issue? |
@WilliamWatterson86 I didn't get any information about it. I hope it was fixed. Closed. But don't be afraid to reopen it again if someone still has this issue. |
Hi @rotorgames , I am facing the same issue. Most of the temporary solutions suggested in this thread hasn't worked for me. C# System.ObjectDisposedException: Cannot access a disposed object. Please help. |
Getting the same issue : System.ObjectDisposedException: Cannot access a disposed object. |
I'm using Rg.Plugins.Popup in my Xamarin.Forms app.
Per not, I haven't much issues with Android (there are some on iOS), but today I had exception, that I'm no able to reproduce again.
However the stacktrace might be helpful to find the root cause:
Xamarin caused by: android.runtime.JavaProxyThrowable: System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Xamarin.Forms.Platform.Android.Platform+DefaultRenderer'. Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable self)<bd30a18775d94dc8b6263aecd1ca9077>:0 Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(string encodedMember, IJavaPeerable self, JniArgumentValue* parameters)<bd30a18775d94dc8b6263aecd1ca9077>:0 Android.Views.View.SetBackgroundColor(Color color)<d855bac285f44dda8a0d8510b679b1e2>:0 Xamarin.Forms.Platform.Android.VisualElementRenderer<TElement>.UpdateBackgroundColor()<3364a2d206a142d8a54cb7a9b77626da>:0 Xamarin.Forms.Platform.Android.VisualElementRenderer<TElement>.OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) <Module>.invoke_void_object_PropertyChangedEventArgs(object, PropertyChangedEventArgs)(wrapper delegate-invoke) Xamarin.Forms.BindableObject.OnPropertyChanged(string propertyName) Xamarin.Forms.Element.OnPropertyChanged(string propertyName) Xamarin.Forms.BindableObject.ClearValue(BindableProperty property, bool checkaccess) Xamarin.Forms.BindableObject.ClearValue(BindableProperty property) Xamarin.Forms.Setter.UnApply(BindableObject target, bool fromStyle) Xamarin.Forms.TriggerBase.OnConditionChanged(BindableObject bindable, bool oldValue, bool newValue) Xamarin.Forms.BindingCondition.OnBoundPropertyChanged(BindableObject bindable, object oldValue, object newValue) Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindableObject.BindablePropertyContext context, object value, bool currentlyApplying, SetValueFlags attributes, bool silent) Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, object value, SetValueFlags attributes, BindableObject.SetValuePrivateFlags privateAttributes) Xamarin.Forms.BindingExpression.ApplyCore(object sourceObject, BindableObject target, BindableProperty property, bool fromTarget) Xamarin.Forms.BindingExpression.Apply(object sourceObject, BindableObject target, BindableProperty property) Xamarin.Forms.Binding.Apply(object newContext, BindableObject bindObj, BindableProperty targetProperty) Xamarin.Forms.BindableObject.ApplyBindings(bool skipBindingContext) Xamarin.Forms.BindableObject.ApplyBindings() Xamarin.Forms.BindableObject.SetInheritedBindingContext(BindableObject bindable, object value) Xamarin.Forms.Element.SetChildInheritedBindingContext(Element child, object context) Xamarin.Forms.Element.OnBindingContextChanged() Xamarin.Forms.Cell.OnBindingContextChanged() Xamarin.Forms.BindableObject.BindingContextPropertyChanged(BindableObject bindable, object oldvalue, object newvalue) Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindableObject.BindablePropertyContext context, object value, bool currentlyApplying, SetValueFlags attributes, bool silent) Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, object value, SetValueFlags attributes, BindableObject.SetValuePrivateFlags privateAttributes) Xamarin.Forms.BindableObject.SetValue(BindableProperty property, object value, bool fromStyle, bool checkAccess) Xamarin.Forms.BindableObject.SetValue(BindableProperty property, object value) Xamarin.Forms.BindableObject.set_BindingContext(object value) Xamarin.Forms.Internals.TemplatedItemsList<TView, TItem>.<UnhookItem>d__153.MoveNext() Android.App.SyncContext.<>c__DisplayClass2_0.<Post>b__0()<d855bac285f44dda8a0d8510b679b1e2>:0 Java.Lang.Thread.RunnableImplementor.Run()<d855bac285f44dda8a0d8510b679b1e2>:0 Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this)<d855bac285f44dda8a0d8510b679b1e2>:0 at (wrapper dynamic-method) System.Object:a960454b-0830-44c5-ae98-58470dadd3eb (intptr,intptr) mono.java.lang.RunnableImplementor.n_run(Native Method) mono.java.lang.RunnableImplementor.run()RunnableImplementor.java:30 android.os.Handler.handleCallback()Handler.java:751 android.os.Handler.dispatchMessage()Handler.java:95 android.os.Looper.loop()Looper.java:154 android.app.ActivityThread.main()ActivityThread.java:6186 java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:889 com.android.internal.os.ZygoteInit.main()ZygoteInit.java:779
The text was updated successfully, but these errors were encountered: