2019-12-13 15:59:25.480329+0000 .iOS[3842:190375] [CollectionView] An attempt to prepare a layout while a prepareLayout call was already in progress (i.e. reentrant call) has been ignored. Please file a bug. UICollectionView instance is (
Could you please attach a zipped reproduction solution and expand on the actual and expected behavior?
Hi we would need more info to understand this issue.
@bcaceiro Since we haven't heard from you in more than 30 days, we hope this issue is no longer affecting you. If it is, please reopen this issue and provide the requested information so that we can look into it further. Thank you!
I'm having the same issue on iOS. I'm going to do more tests but it seems that I've started to see this error since X.F 4.5
It happens for me with a CollectionView inside a tabbed page reproduceable on iOS
Steps to reproduce
Expected Behavior
The items added after a clear of the CollectionView gets displayed
Actual Behavior
CollectionView is not showing anything
Basic Information
Reproduction Link
CollectionViewBindingRepro.zip
I cannot update to Xamarin Forms. 4.5 as as soon as I do it, the app for iOS doens't work anymore (it works fine on Android). When I go back to Xamarin Forms 4.4 then it works again on iOS.
I have a CollectionView on my first (after login) content page. on X.F. 4.5 and iOS, that contentview has a wrong layout: I can see the bottom half of the second item but it's like there is a white layout on top of the CollectionView so I can see nothing else.
Expected Behavior
The CollectionView shows items correctly
Actual Behavior
CollectionView is not showing items correctly
Basic Information
Version with issue: from 4.5.0.356
Last known good version: 4.4.0.991757
IDE: Visual Studio 2019
Platform Target Frameworks:
iOS: 13
I can add this, maybe it can help:
This issues seems to happen when the CollectonView is inside a RefreshView.
If I remove the RefreshView, then it works fine.
this bug happens for me also
i have a login page => after successful login a new app shell starts with tabs and the main tab contains a grid and that grid contains a refresh view inside this refresh view i have my collection view
Error Message
[CollectionView] An attempt to prepare a layout while a prepareLayout call was already in progress (i.e. reentrant call) has been ignored. Please file a bug. UICollectionView instance is (
System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index'
Expected Behavior
The CollectionView shows items correctly after loading of any refresh
Actual Behavior
app crash
Basic Information
Version with issue: 4.6.0.800 latest stable
Last known good version: -
IDE: Visual Studio 2019
Platform Target Frameworks:
iOS: 13.5
I have a problem the same with message above.
[CollectionView] An attempt to prepare a layout while a prepareLayout call was already in progress (i.e. reentrant call) has been ignored. Please file a bug. UICollectionView instance is (
How to used:
<DataTemplate x:Key="ItemViewTemplate">
<Grid
x:Name="ItemTemplate"
WidthRequest="120"
HeightRequest="100"
Style="{StaticResource StyleGrid}"
Padding="10"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
BackgroundColor="White">
.....
</Grid>
</DataTemplate>
<CollectionView
x:Name="itemCollectionView"
Grid.Column="2"
VerticalScrollBarVisibility="Never"
HorizontalScrollBarVisibility="Never"
ItemsSource="{Binding SubCategoryOutputs}"
ItemTemplate="{StaticResource ItemViewTemplate}">
<CollectionView.ItemsLayout>
<GridItemsLayout
Span="2"
Orientation="Vertical"
VerticalItemSpacing="0"
HorizontalItemSpacing="0" />
</CollectionView.ItemsLayout>
</CollectionView>
After load data completed it show message above and try to selected item to details it does't happen to show UI (stuck app) can't navigation back or do anything with application.
Basic Information
Version with issue: Latest stable 4.6.0.847
Last known good version: -
IDE: Visual Studio 2019
Platform Target Frameworks:
iOS: 13.5
So please help to resolve this problem ?
Thank you in advances.
I was able to recreate and fix this.
remove your collectionview from any nested scrollview guys.
it will work again as usual.
I was able to recreate and fix this.
remove your collectionview from any nested scrollview guys.
it will work again as usual.
I don't have scroll view on that page it's just nested grids and refresh view containing the collection view
I was able to recreate and fix this.
remove your collectionview from any nested scrollview guys.
it will work again as usual.I don't have scroll view on that page it's just nested grids and refresh view containing the collection view
Hi,
Also noticed this.
is your collectionview is visible while you set the datasource?
if it or its container is not visible, just noticed this issue also occurs for me.
I was able to recreate and fix this.
remove your collectionview from any nested scrollview guys.
it will work again as usual.I don't have scroll view on that page it's just nested grids and refresh view containing the collection view
Hi,
Also noticed this.
is your collectionview is visible while you set the datasource?
if it or its container is not visible, just noticed this issue also occurs for me.
The collection view and its containers are visible it just have empty template and search handler for shell page
Also i tried to remove the refresh view and search handler but it still crashing 馃槥
Also i tried to remove the refresh view and search handler but it still crashing 馃槥
for me, its not crashing. but freezing my friend.
can you add a try catch to InitializeComponents() method of your page and check?
I'm facing this issue as well on iOS:
[CollectionView] An attempt to prepare a layout while a prepareLayout call was already in progress (i.e. reentrant call) has been ignored. Please file a bug. UICollectionView instance is (
I'm on a tabbed page. Is there any workaround?
Using the new feature "path" causes that proplem for me when i removed it from the collection view it loaded without crash
Information around the issue:
The issue occurred on a Tabbed Page, when loading around 300 items on the list. The collection view loads fine on the start, then while scrolling down the error appears. I was using Xamarin.Forms 4.7 SP1 latest version and I had to downgrade to 4.6.0.967.
I have the same problem :(
I had in xamarin 4.6.0.772 and now in 4.7.0.1142 latest release same problem
Xamarin.Mac
Version: 6.16.0.11 (Visual Studio Community)
Hash: aa73e4125
Branch: d16-5-xcode11.4
Build date: 2020-03-25 11:04:02-0400
Xamarin.iOS
Version: 13.18.2.1 (Visual Studio Community)
Hash: 29c4ea731
Branch: d16-6
Build date: 2020-05-26 17:03:05-0400
[CollectionView] An attempt to prepare a layout while a prepareLayout call was already in progress (i.e. reentrant call) has been ignored. Please file a bug. UICollectionView instance is (


I am also now seeing this same issue after upgrading Xamarin.Forms from 4.5.0.356 to 4.8.0.1269. Did anyone by any chance find a workaround?
I had the same issue - and tried a lot of things... but eventually narrowed it down to this:
I have a CollectionView (in a RefreshView) bound to an itemssource with different datatypes. One of the items added had its own viewmodel, which loaded data from a REST api on a background thread - after data was received some properties were set affecting visibility of the item. this caused the error and the CollectionView wouldn't render anything.
I've changed my binding for ItemsSource to be set in codebehind after all (initial) items has been loaded from REST-backend. There are no longer any items, that load additional data, but is now rendered as simple items/models using a datatemplate selector.
Oddly enough, setting the binding through xaml, won't render the items - only setting binding after loading the first batch of items works on iOS. Android works as expected.
The underlying list of items is an ObservableCollection
I've also experienced similar problems, when using an ObservableCollection and calling property changed after adding to the items collection. This seems to trip on iOS also not rendering any items. Letting ObservableCollection handle the change notifications seemed to handle some of my issues.
Hope this helps.
I worked around this issue by initialazing the ObservableCollection in the constructor of the ViewModel with an empty item.