Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CollectionView with IsGrouped="True" throws NSInternalInconsistencyException with iOS 18 SDK #24971

Closed
velocitysystems opened this issue Sep 27, 2024 · 5 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending t/bug Something isn't working

Comments

@velocitysystems
Copy link
Contributor

velocitysystems commented Sep 27, 2024

Description

CollectionView with IsGrouped="True" throws a NSInternalInconsistencyException.
This happens when built with Xcode 16/iOS 18 SDK.

Note: This did not happen when building with Xcode 15.4/iOS 17.x SDK.

Steps to Reproduce

Create a blank MAUI app.
Add a CollectionView to a page with a data source and grouping enabled.

Link to public reproduction project repository

No response

Version with bug

8.0.91 SR9.1

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.91 SR9.1

Affected platforms

iOS

Affected platform versions

.NET 8.0.1xxx - Xcode 16.0 Support (8303)

Did you find any workaround?

Disable grouping.

Relevant log output

Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]. Dequeued view: <Microsoft_Maui_Controls_Handlers_Items_VerticalSupplementaryView
@velocitysystems velocitysystems added the t/bug Something isn't working label Sep 27, 2024
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@velocitysystems
Copy link
Contributor Author

Tested with 8.0.99-ci.net8.24477.4 and can confirm the NSInternalInconsistencyException is no longer thrown.
This appears to be fixed by #24873. Closing as a duplicate of #17969.

@LeoJHarris
Copy link

LeoJHarris commented Oct 1, 2024

This is a blocking issue, our app immediately crashes with Xcode 16 but we are struggling to roll back as we have already updated to the latest MAUI workloads and the current error raised when trying to target Xcode 15.4 are for example:

error MT4162: The type 'UIKit.UITextFormattingViewController' (used as a parameter in UIKit.UITextView/_UITextViewDelegate.DidBeginFormatting) is not available in iOS 17.5 (it was introduced in iOS 18.0). Please build with a newer iOS SDK (usually done by using the most recent version of Xcode). 

We have not updated MAC OS yet, does anyone have work around or the cmd lines to rollback to previous MAUI workloads? Or rolling back to a specific workload such as 4.0.100

@velocitysystems
Copy link
Contributor Author

@LeoJHarris You can install Xcode 15.4 and use the previous workload version:

dotnet workload install maui --version 8.0.402.0

If you are building your app in a pipeline i.e. Azure DevOps you can do something like this:

- task: CmdLine@2
  displayName: Set Xcode Version
  inputs:
    script: sudo xcode-select -s /Applications/Xcode_15.4.app

- task: DotNetCoreCLI@2
  displayName: dotnet workload install
  inputs:
    command: custom
    custom: workload
    arguments: install maui --version 8.0.402.0

@samhouts samhouts added platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Oct 1, 2024
@LeoJHarris
Copy link

LeoJHarris commented Oct 1, 2024

@velocitysystems that worked

Running in the cmd line:
dotnet workload install maui --version 8.0.402.0

Also my Mac OS is still using Sonoma 14.7 which is probably my saving grace at the moment. The entire MAUI iOS eco system seems extremely fragile atm. But this is the only thing that work for me and probably the best I can upgrade to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/iOS 🍎 potential-regression This issue described a possible regression on a currently supported version., verification pending t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants