XamarinCommunityToolkit: [Bug] StateLayout: Collection was modified
Description
I thought I’d use StateLayout in a tutorial page, the first time you see the page it shows some information, every subsequent load you dont see the info. This page is my root of my FlyoutPage, if you navigate to a page you leave it, if you deselect that page you go back to this page (its a background page).
When navigating back to this page after changing my code over from a IsVisible="{Binding ShowTutorial}" pattern, I noticed I was getting the following crash:
at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:1163
at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:1156
at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].MoveNext () [0x0004e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.Linq/src/System/Linq/Where.cs:140
at System.Linq.Enumerable+<OfTypeIterator>d__32`1[TResult].MoveNext () [0x00067] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.Linq/src/System/Linq/Cast.cs:24
at System.Linq.Enumerable+SelectIListIterator`2[TSource,TResult].MoveNext () [0x00029] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.Linq/src/System/Linq/Select.cs:487
at System.Threading.Tasks.Task.WhenAll[TResult] (System.Collections.Generic.IEnumerable`1[T] tasks) [0x000ba] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:5657
at Xamarin.CommunityToolkit.UI.Views.StateLayoutController.ChildrenFadeTo (Xamarin.Forms.Layout`1[T] layout, System.Boolean animate, System.Boolean isHide) [0x000ae] in <fa8f5d76b92c43368c40cb2294002440>:0
at Xamarin.CommunityToolkit.UI.Views.StateLayoutController.SwitchToContent (System.Boolean animate) [0x00098] in <fa8f5d76b92c43368c40cb2294002440>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.8.0.3/src/Xamarin.iOS/Foundation/NSAction.cs:178
--- End of stack trace from previous location where exception was thrown ---
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.8.0.3/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.8.0.3/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at Senso.Client.Mobile.iOS.Application.Main (System.String[] args) [0x00001] in /Users/***********/MyApp/Main.cs:17
I don’t have a suitable reproduction because but that is a crash coming from this framework so I thought I’d report it now!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (13 by maintainers)
Commits related to this issue
- Try to fix https://github.com/xamarin/XamarinCommunityToolkit/issues/784 — committed to xamarin/XamarinCommunityToolkit by AndreiMisiukevich 3 years ago
@AndreiMisiukevich Can confirm this issue is not happing in the latest versions of all packages (XCT 1.0.3, XF 5.0.0.1931) 😄
I’m happy to close this issue if thats alright with everyone
Ah OK, understandable, but that is a good thing to mention in your next bug report then 😃
Because this might have all kinds of causes then: maybe Prism, maybe Forms 4.8, maybe Toolkit. Again, I understand your position, but I hope you’ll also understand this is not something we can fix if we don’t know this is happening in the latest bits of our code as well. Maybe this is something that is already fixed and we’re now about to implement code that potentially changes other things or even breaks something while there was no issue to begin with.
If there is a way to verify this with the latest stable release (1.0.2) and can confirm this is still happening that would be great. Else I’m inclined to close this one for now until we can