-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] Layout.ResolveLayoutChanges crashing on System.ObjectDisposedException #10159
Comments
I can confirm the issue. Tested on Android Emulator and real device using XF 4.6.0-pre2.
|
tested on XF 4.6.0 pre3
|
Does anyone have a reproduction they could zip and attach? |
In my example it's really hard to create a reproduction project, because the issue does not occur in a for me reproducable way. And until now I was not able to figure out what exactly triggers it. I just can say that all ui changing actions are fired on mainthread, because a race condition as described in #9753 was the first I thought of. |
Same random Error with XF 4.6.0.726 JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) |
We have not been able to repro this locally, we only see this in crash reports from customers out in the wild. So unfortunately no good way of providing a solid repro project from myself. |
Just tested it on 4.6.0.726 and I still see this issue. I tried to create repro but with no luck as the issue is very random. Maybe this could be related to #10031 (It's ImageRenderer but the stack and exception look the same). |
Great Reveon, I think that it probally is the same issue , it is very random. So, hardest to know the cause exception and could be verified asap , We need to find the solution quickly, this is being very bad. |
I can reliably reproduce this issue with one of our production apps. Because it's a commercial app, I can't publicly post the source code. @kingces95 or @samhouts how can I privately submit a repro to Xamarin/Microsoft; and would you be willing/able to sign an NDA first (my boss would prefer that)? |
Hi, same problem with 4.6.0.772, i downgrade again in 4.3.0.991211 |
@Sylv1F You should actually be OK with 4.4.x - I just tested every released build upwards from 4.3.x - every build up to and including 4.4.0.991864 worked fine. Starting with 4.5.0.356, this crash occurs. So it seems the bug was introduced in XF 4.5. |
@mpnow Thanks ! I upgrade framework after framework. |
Upgrade to XF 4.6.0.800 crash, downgrade in XF 4.5.0.266 ok |
Last really stable XF : XF 4.4.0.991864 |
@Sylv1F Downgrading to XF 4.4.0.991864 "fixed" the issue for me. Thanks for sharing |
just tested 4.7.0.937-pre4 and the issue is still there |
I found the origin of my crash. I have a masterdetailpage with a MasterDetailPage.Master with a listview and a MessagingCenter.Subscribe. This Listview contains an ObservableRangeCollection . Before XF 4.5 no problem I added INotifyPropertyChanged to Items, it looks better ... |
87/5000 |
Bug still exists in Xamarin.Forms 4.8.0.1269 for 2 emulators Android versions 7.1 and 9.0. JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self)
|
I can confirm, that for me XF 4.4.0.991864 did NOT fix it, still geting same exception. |
Bug still exist in Xamarin.Forms 4.8.0.1364
|
See what I found where the crash is happening: https://github.com/xamarin/Xamarin.Forms/blob/main/Xamarin.Forms.Platform.Android/Platform.cs
|
Can anyone who is seeing this issue test with the nuget here? And then please let me know if you still see the exception? |
I tested a project with the same error, Xamarin 5.0.0.1539-pre2 and it still persists
Using this line Without flag line the ObjectName: |
I'm wondering if anyone has tried this with Xamarin 5.0 pre-6, and what their results have been? I haven't been able to repro the crash with that version, but then again, it's an intermittent crash so it's hard for us to reproduce. |
I am getting the same crash with Xamarin.Forms 5.0.0.1874 and it's occurring in Android version > 10
|
Xamarin.Forms.Platform.Android/Platform.cs
It should just be updated here
|
@VNGames It wouldn't have hurted to add the code there as well, although it is strongly encouraged to use the "fast" renderers which should be enabled by default. However, for whoever that might still be watching this, a PR (#14933) for this is open now, would you be able to grab the NuGet as described here and let us know if this fixes this issue? That will greatly speed up the review process. Besides verifying if this particular issue is fixed also be sure to check other scenarios in the same area to make sure that this fix doesn't accidentally has side-effects 🙂 Thanks! |
Description
We are seeing sporadic crashes specifically on Android where we get System.ObjectDisposedException: Cannot access a disposed object when doing Layout.ResolveLayoutChanges for Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer
Expected Behavior
It should not crash
Actual Behavior
It crashes for customers and users
Workaround
No known workarounds currently.
Basic Information
Version with issue: 4.6.0-pre2
Last known good version: Unknown
IDE: VS For Mac
Android Support Library Version: N/A
Affected Devices: Random Android devices
Platform Target Frameworks:
Stack trace
The text was updated successfully, but these errors were encountered: