-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] [iOS] Cannot access a disposed object. Object name: 'GroupableItemsViewController`1 #8308
Comments
Any ideas for a workaround? |
Same behaviour with a TabBar. Is there any investigation ongoing? AppShell.xaml
Debug Log
Exception Message
|
I just got this same error from an otherwise-working app revision that has been out for a month. Occurred on iOS 12.4.1. Report from AppCenter, so details limited and I haven't been able to reproduce it. Most people seem to never encounter it. |
@BioTurboNick which version of Xamarin Forms do you use? Because your problem looks like something else. |
Hmm maybe so. I'm on 4.2.0.848062. Still, I had never seen an ObjectDisposedException from GroupableItemsViewController before now, ever. |
I tested this bug on 4.2.0.9... and it worked fine. Probably this is something else? |
Regarding XF SDK Version: 4.3.0.947036 (latest stable) |
I filed a new issue because it's related but happens on a TabBar: #8394 |
same issue come but without grouping. in forms version 4.3 |
I had the problem with a collection view with a footer. Removing the footer appears to have resolved the problem. |
I get this bug with a simple (I think) collection view, I'm using Xamarin Forms 4.4.0.991265, with a listview it works fine
It renders the first time but when I do a 'hot reload' it breaks with:
|
After updating to 4.4.0.991265, I'm running into this again - even on collection views without headers or footers. :( |
Please fix this urgently. I also have this issue. Cannot use shell in production because of it. Should be marked critical. Steps to Reproduce |
Same problem. Why is this not fixed yet? |
What @jsiemens said 👆 |
It's quite impressive this wasn't fixed yet, i'm also having this bug, the CollectionView never worked properly on iOS |
@l0gaw 's workaround used to work, but now it doesn't. Can't tell if it is from the last iOS update, or not, but it is getting really annoying - crashes everywhere from simple update/clear. |
@mduchev I'm seeing this as well. It's happening on both iOS 13 and 14. The only thing that changed for me was moving to Xamarin.iOS 14. Trying to see if I can come up with a workaround now. Specifically, here's the stack I see now:
|
After publishing out the suggested workaround, I am now seeing this exception in App Center: System.IndexOutOfRangeException: IItemsViewSource is empty
|
Are you removing an item from the collection? If so, then you may have hit another reported issue (which I am also hitting constantly) - #9632. If not, then I suppose that, as I said above, the workaround isn't working in all of the cases, unfortunately. |
I was able to recreate the last issue I posted. When I navigate to a screen where I have a CollectionView and I modify it by either adding or removing an item, then closing the screen this exception is thrown. If I go to the same screen and don't modify the CollectionView, then exit the screen the exception is not thrown. The workaround is still working for me, though, I did have to refactor some areas because clearing the CollectionView will crash. So, the workaround will definitely introduce new issues. I think the safest bet at this point is not to use CollectionViews. |
I have same issue.
At the point, error throws on my experience.
|
It would be a lot easier to fix if someone can provide a sample project with the latest Xamarin packages. I can't seem to be able to pinpoint the exact case when this happens constantly. If someone can, please provide a demo project describing the issue so that it can be fixed quickly. |
@mduchev Did you see this comment from @daves1992? Just asking since it is somewhat buried in the flood of comments. Does it not reproduce the issue for you? |
@lafritay Unfortunately, no. I am able to launch the project on both a simulator & device without any issues. Navigating between the pages also doesn't seem to trigger the exception. |
Which version of IOS? I managed to replicate it on 12.4.1 but I don't think it replicated on later versions. |
You have to be on iOS 12 to recreate. |
@rd09 Not true. I was seeing the same error on iOS 13 devices and now I'm seeing it again on iOS 14 devices. Unfortunately, the sample projects don't seem to recreate the issue so I suppose that it still persists in some other shape. |
repro + solution: #11853 no workaround. |
@mduchev @rd09 I was able to get a simple repro: Once you load the app, wait for the items to load. Then do the following:
The key to making this happen is this line in ItemsPage.xaml.cs
The problem is that if I believe the issue is the This seems to be confirmed by the fact that it's Android counterpart does dispose of the object (see And, I think one of the big reasons why this continues to happen is that the workaround that many people are using nulls out the ItemsSource when dispose is called. |
@lafritay Im using this workaround which seems to work in short testing. This is not fixing the dispose entirely when the collection source is change correct, but prevents the crashes I had
|
@jormenjanssen Here's my full workaround:
|
This workaround worked in my case. I did remove also the line "ItemsView.SelectedItem = null" because it is not needed in my case just like what @rd09 said. |
same issue happened with me, any solution or workaround ?... this is the stack trace ... |
This repro no longer crashes as of 4.8.0.1364. |
@ahmedroshdy You are seeing this using Xamarin.Forms 4.8.0.1560? |
Description
A collection view with header causes a crash after navigating via the shell flyout.
The bug is iOS only. On Android it works fine.
The app wont crash if you use tabs.
Steps to Reproduce
--> The App will crash
Expected Behavior
Not crashing.
Actual Behavior
Throws:
Basic Information
Reproduction Link
BugExample.zip
The text was updated successfully, but these errors were encountered: