I've been trying to make an app written in Xcode 9 for iOS11 iOS9.0-compatible and all of a sudden it crashed with this error on iPhone 4S:
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named _UIColorAttributeTraitStorage'
Same project runs fine on iPhone 7.
I've changed all [UIColor colorNamed:] as Xcode suggests:
if (@available(iOS 11.0, *)) {
statusBar.backgroundColor = [UIColor colorNamed:@"MyColor"];
} else {
statusBar.backgroundColor = kColorFromHex(0x509E2F);
}
But the error didn't go anywhere. I also didn't find any mention of UIColorAttributeTraitStorage in Apple Documentation or anywhere on the web except some japanese(?) post. All I understood from this post is that someone probably faced the same issue with Color Set in iOS 10.3 and Xcode 9.
So it seems the problem is in xcassets containing Color Sets. Does this mean there is no backwards compatibility for Color Sets? And that if I add one there's no way to distribute my app for iOS lower than 11.0?
P.S.: I don't have any iOS 10 device, so I don't know if the issue is still there for 10+ since Xcode 9 public release. Can anyone give it a try?


