Xcode 15 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named StopwatchSupport.ActivityIndicatorVisualStyle

Hello I'm encountering a strange error, probably linked to a bug in Xcode 15 beta 2. When running my app from xcod 15 Beta 2 (either on device running iOS16.5.1 or any simulator running iOS17) for some views I receive the following fatal error:

'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named StopwatchSupport.ActivityIndicatorVisualStyle because no class named StopwatchSupport.ActivityIndicatorVisualStyle 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)'

From the stack trace, the error seems to be appearing just afterthos calls:

#3 0x00000001b3faef54 in UINibDecoderDecodeObjectForValue () #4 0x00000001b3faf1ec in UINibDecoderDecodeObjectForValue ()

Thanks for any help guidance provided.

Post not yet marked as solved Up vote post of arex Down vote post of arex
1.1k views

Replies

I'm seeing the same thing at Beta 3

ditto, beta #3

Still present in Xcode beta 4.

Seems to happen when I try to present an UIActivity indicator thatI have set in a xib file.

    0   CoreFoundation                      0x000000010f3c988a __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x000000010b00d894 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010f3c9768 -[NSException initWithCoder:] + 0
    3   UIFoundation                        0x0000000129c61b4d UINibDecoderDecodeObjectForValue + 352
    4   UIFoundation                        0x0000000129c61ebe UINibDecoderDecodeObjectForValue + 1233
    5   UIFoundation                        0x0000000129c619e2 -[UINibDecoder decodeObjectForKey:] + 257
    6   UIKitCore                           0x0000000130d23a9f -[UIView initWithCoder:] + 1327
    7   UIKitCore                           0x000000013067be13 -[UIActivityIndicatorView initWithCoder:] + 65

I did a quick test where this bug shows up in my UI, by removing the said UIActivityIndicatorView from code and xib files, then, the crash disappear, so it is definitely linked to UIActivityIndicatorView and is most probably an Xcode 15 / iOS17 bug as it compiles and runs perfectly under iOS 16.x or when compiled and run on iOS 17 simulator from Xcode 14.

Same problem with Xcode 15 beta 4, especially when compiling on a physical device (iOS 17 beta 3).