I've been pounding my head against the wall trying to figure out why my Xamarin Forms app intermittently crashes while loading. This occurs in both Android and iOS. We've added some unhandled exception logging to try and capture some information, and every once in a while we get a "Collection was modified; enumeration operation may not execute" error that crashes the app. I traced it to two separate lines of code that both add operational layers to the map - vector tile package layers and feature layers from a SQLite geodatabase. The more layers we add to the map the more frequently we get app crashes.
My app has some serious girth, so to rule out some other culprit I just created a slimmed down repro app that downloads 11 vector tile packages and loads them into the map. I added a Reload Map button that reinstantiates the map and adds those 11 vector tile packages to the map. This basically emulates the app loading and map layer population that occurs in my real app. If I continually click that reload map button I can get the app to crash pretty reliably, so the issue is still intermittent but it does definitely occur in this slimmed down repro app. This seems to point to some low level bug in the OperationalLayers.Add method on the map.
I'm willing to supply this repro case to the Esri development team, but I don't want to post it here as it has some URLs and proprietary information that shouldn't be exposed to the masses. I am also willing to call in a support request on this, but it usually takes a few days until it gets to someone that can actually help. If one of you guys can let me know where I can send the repro, hopefully you can quickly determine whether or not this is something we can work around or if we're SOL until the next release of the API. We have a customer roll out occurring this week, and we obviously do not want to give this app to them with all this instability.
Any help here would be greatly appreciated ...