iOS 17 Update Causes App to Crash on Some Devices

When a user updates their device to iOS 17 (any version) on a device with MDM, our app crashes but only on some device, not all. The same app runs fine on iOS 16. We cannot recreate the issue in-house and even our customers cannot reliably recreate the crash as it only happens on some devices and not others.

The crash we get is: SIGABRT: UICollectionView internal inconsistency: missing final attributes for cell

Once the device gets this crash, the only way to fix it is to delete and reinstall the app and then everything works fine.

Anyone having a similar issue with iOS 17 and MDM?

Replies

Hi, Adding a crash report might help, but in addition to that, it would be helpful have some idea of what operations were being performed on the collection view before the crash. Could you try enabling some debug logging available in UICollectionView, and then asking your users to trigger a sysdiagnose immediately after they run into the crash.

The logs can be enabled by setting some defaults like so:

int main(int argc, char * argv[]) {
    NSString *className = nil;
    NSString *delegateClassName = nil;
    @autoreleasepool {
        NSUserDefaults *uikitDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"com.apple.UIKit"];
        [uikitDefaults registerDefaults:@{@"LogUICollectionView": @YES, @"LogUICollectionLayout": @YES}];
        delegateClassName = NSStringFromClass([<YOUR_APP_DELEGATE_CLASS>  class]);
        className = NSStringFromClass([UIApplication class]);
    }
    return UIApplicationMain(argc, argv, className, delegateClassName);
}

Please see https://forums.developer.apple.com/forums/thread/739560 for more information about sysdiagnoses.

  • @caughtinflux Just wanted to follow up and see if you were able to determine anything from the uploaded crash report. Thanks!

Add a Comment

Thank you for the reply, we will work on getting a sysdiagnose from one of our customers.

Regarding the last operations being performed, the crash is pointing to code that returns the height of the collectionview, specifically, it is calling layoutIfNeeded() We also tried to remove that call but it did not prevent the crashes.

Here is the crash report:

Thanks for your help!

  • I am having this same issue with layoutIfNeeded() - did you ever find out what was causing the issue? @2018code @caughtinflux

  • @williamj323 I have not found a solution nor have I heard back from Apple since posting the crash report. I did remove the layoutIfNeeded() but still get the crash. For our app, it seems to be isolated to devices that are running an MDM and then upgrade to iOS 17.

Add a Comment