Home > Blockchain >  App builded by Xcode version 13 crashed on ios 12
App builded by Xcode version 13 crashed on ios 12

Time:09-27

My app is working fine on iOS 15 and 14, maybe 13 too. But when I run on older device using iOS 12, its crash on start, even before didFinishLaunchingWithOptions is triggered. It was working fine the last time I build using Xcode 12.

Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named UINavigationBarAppearance because no class named UINavigationBarAppearance was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)' terminating with uncaught exception of type NSException

CodePudding user response:

In Xcode 13, the storyboard editor (and therefore the storyboard itself) contains information about the nav bar appearance (UINavigationBarAppearance):

enter image description here

But there is no such class in iOS 12, so this storyboard is not compatible with running under iOS 12.

You might be able to get out of that by making your storyboard backward compatible to iOS 12:

enter image description here

But I have not tried that personally, so no guarantees.

  • Related