I have experienced the below crash several times during testing when sliding items quickly back and forth with CarouselView. The crash happens with 1.6.3 and 1.6.4-pre. I have tested it in Simulators and with physical devices and I can repro with both. I have been using Visual Studio 2017 (I have not tested with VS4M yet):
Unhandled Exception:
Foundation.MonoTouchException: Objective-C exception thrown. Name: NSGenericException Reason: *** Collection <CALayerArray: 0x600002ce3420> was mutated while being e

numerated.
Native stack trace:
0 CoreFoundation 0x000000011110529b __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000111e59735 objc_exception_throw + 48
2 CoreFoundation 0x0000000111101f7c __NSFastEnumerationMutationHandler + 124
3 UIKitCore 0x000000011bf0b279 -[UIView(Hierarchy) subviews] + 363
4 UIKitCore 0x000000011bf24887 -[UIView(CALayerDelegate) _wantsReapplicationOfAutoLayoutWithLayoutDirtyOnEntry:] + 57
5 UIKitCore 0x000000011bf25055 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1505
6 QuartzCore 0x0000000109a9bd3d -[CALayer layoutSublayers] + 175
7 QuartzCore 0x0000000109aa0bf7 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 395
8 QuartzCore 0x0000000109a19aa6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 342
9 QuartzCore 0x0000000109a50c2a _ZN2CA11Transaction6commitEv + 576
10 Spike.CarouselView.iOS 0x0000000103717a79 xamarin_dyn_objc_msgSend + 217
11 ??? 0x0000000136c4ecd0 0x0 + 5213842640
12 ??? 0x0000000136bf46f3 0x0 + 5213472499
13 Spike.CarouselView.iOS 0x00000001035253c1 mono_jit_runtime_invoke + 1441
14 Spike.CarouselView.iOS 0x000000010360bcff mono_runtime_invoke_checked + 127
15 Spike.CarouselView.iOS 0x0000000103654c4a start_wrapper_internal + 602
16 Spike.CarouselView.iOS 0x00000001036549c7 start_wrapper + 71
17 libsystem_pthread.dylib 0x00000001137e333d _pthread_body + 126
18 libsystem_pthread.dylib 0x00000001137e62a7 _pthread_start + 70
19 libsystem_pthread.dylib 0x00000001137e2425 thread_start + 13
Hi @jonasrembratttetrapak i think, this is xamarin.forms bug.. something isn't locked in iOS renderer (I think adding/removing Child in AbsoluteLayout)
Can you create an issue form xamarin team (with attached sample)
Also you could try to set DesiredMaxChildrenCount = 12
Hi @AndreiMisiukevich. I'll try and run with Xamarin.Forms source code and see what I find. I'll also test setting the DesiredMaxChildrenCount as you suggested.
If it's a Xamarin.Forms thing I'll add an issue for it
Alas, I could still repro the crash with DesiredMaxChildrenCount set to 12. I'll try running with your (and Xamarin.Forms) source code next to see what's going on.
@jonasrembratttetrapak i appreciate ! Thank you very much. Keep me posted
I also get this error now...@jonasrembratttetrapak did you find something to solve this ?
maybe its related to this:
https://github.com/xamarin/Xamarin.Forms/issues/2087
Alas, no. We're using this control now instead: https://github.com/alexrainman/CarouselView
ok, funny, since I've started with Alex control and changed to this one, since I got to many errors with the other one, especially these NSGenericExceptions.
Yes, Alex's control is not bug free but we've found it to be quite robust. There's been a few issues but all within the source code (the latest version isn't packaged yet so we're running the source code). We found one GC/Dispose bug but we fixed that (and we will be forwarding it to Alex).
@shoeIT @jonasrembratttetrapak that's very well, when there is alternative, i think :)
Hey guys
Did you go to another solution?)
I think, this issue can go away with new releases )
Hey Andrei, still with your solution, do I have to change anything to avoid the issue? What did you change in this release?
I updated from 2.00 to 2.03 and some of my logic don't work anymore I gonna check now, whats up exactly. Besides I saw the UserInteraction event. Is it new? I think this could help since the error mosty happend when there was fast user interaction an swipes.
@shoeIT could you please show errors - i will help resolve them
Yes, i obsolete and removed some logic...
ok, funny, since I've started with Alex control and changed to this one, since I got to many errors with the other one, especially these NSGenericExceptions.
I have been facing same
@aman720gupta hi
Have you tried latest version?
Also, try to set MaxChildrenCount = 30 and DesiredMaxChildrenCount = 30
@shoeIT could you please show errors - i will help resolve them
Yes, i obsolete and removed some logic...
atm I have no time to look into the problems. I use verson 2.0 and it works well so far. But I will have a look and contact you.
btw. how could MaxChildrenCount and DesiredMaxChrildenCount change the behaviour. I don't completly understand the properties out of the documentation.
ok, funny, since I've started with Alex control and changed to this one, since I got to many errors with the other one, especially these NSGenericExceptions.
I have been facing same
with Alex CV or with this one?
@shoeIT ..need to update documentation.
MaxChildrenCount - absolute maximum count of children (cards) which can be added to CardsView (AbsoluteLayout) in one time. So if you swipe quickly in any moment you can create a lot of cards. for better memory managing we remove several (if user interacts with CardsView now)
DesiredMaxChildrenCount - very similar.. but it manages "best" count of children (if user doesn't interact with CardsView now)
Hope it makes sense. So you can set big values and it will allow to avoid removing children from layout.
@aman720gupta hi
Have you tried latest version?
Also, try to set MaxChildrenCount = 30 and DesiredMaxChildrenCount = 30
Hi
I'm using latest version but let me check with this values
ok, funny, since I've started with Alex control and changed to this one, since I got to many errors with the other one, especially these NSGenericExceptions.
I have been facing same
with Alex CV or with this one?
I'm facing a crash in Alex CV on removing an element from list view having carousel(Objective-C exception is thrown. Name: NSInternalInconsistencyException Reason: No view controller managing visible view),
and also facing crash here as well
It would be awesome to have sample with fast reproduction of this crash.