3

We have crashes only for iOS 15 with description: "A view controller not containing an alert controller was asked for its contained alert controller" We can't locate problem code. And also can't reproduce the crash. Stacktrace doesn't say us much.

Are the any known issues with iOS15?

The Staktrace (from Xcode and AppCenter):

LAST EXCEPTION BACKTRACE

CoreFoundation __exceptionPreprocess libobjc.A.dylib objc_exception_throw Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] UIKitCore +[UIAlertController _alertControllerContainedInViewController:] UIKitCore -[_UIAlertControllerAnimatedTransitioning _alertControllerForContext:] UIKitCore -[_UIAlertControllerAnimatedTransitioning transitionDuration:] UIKitCore -[UIPresentationController runTransitionForCurrentState] UIKitCore -[_UIAfterCACommitBlock run] UIKitCore _runAfterCACommitDeferredBlocks UIKitCore _cleanUpAfterCAFlushAndRunDeferredBlocks UIKitCore _afterCACommitHandler CoreFoundation CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION CoreFoundation __CFRunLoopDoObservers CoreFoundation __CFRunLoopRun CoreFoundation CFRunLoopRunSpecific GraphicsServices GSEventRunModal UIKitCore -[UIApplication _run] UIKitCore UIApplicationMain MobileBank main main.swift:13 0x000000010b891a24

  • 1
    "Stacktrace doesn't say us much" You don't say much to describe an issue, either. – El Tomato Oct 11 '21 at 08:17
  • Sorry about that. Couldn't attach the stack trace. I posted the stack trace of crashed thread. There's nothing more on other threads. We can see that something wrong with usage of AlertController. But we can't see the app's code in the stack trace, so we have no idea where exactly the wrong code. And there's no crashes with the same reason on other iOS versions. – Igor Shvetsov Oct 11 '21 at 08:22
  • 1
    You may want to show lines of code where `UIAlertController` is used. – El Tomato Oct 11 '21 at 08:23
  • Do you have breadcrumbs or any data knowing where the user went in your app (with Firebase, Sentry, etc.)? Can you find the bug in XCode/Organizer, would it point you to some better line? – Larme Oct 11 '21 at 08:24
  • 1
    unfortunately, no. the app crashes after app start. crash report from AppCenter gives us only the description that I put in subject. The crash report on Xcode organizer contains the same stack trace as in AppCenter – Igor Shvetsov Oct 11 '21 at 08:29
  • 1
    _You may want to show lines of code where UIAlertController is used._ there're thousands of them – Igor Shvetsov Oct 11 '21 at 08:33
  • 1
    I'm seeing the same crash on iOS 15. Did you ever find the cause Igor? – Rengers Dec 23 '21 at 14:58
  • Just got the same stack and the same issue. Crash happened after ` self.presentingViewController?.dismiss(animated: true)` call called from `- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(nullable NSError *)error;` of MFMailComposeViewControllerDelegate – Krypt Apr 06 '22 at 05:31
  • Try to present your alert controller from the main thread. This solved the problem for me. – Awais Fayyaz Jul 25 '22 at 11:34

0 Answers0