App crashing only when submitting it for review (NSInvalidUnarchiveOperationException)

Hello,


has anyone seen a problem similar to this one? Any hint?


The application is built with Catalyst and reviewers say it crashes on start, while it works flawlessly on my Mac. The stacktrace I got from the reviewers seems to point to something wrong with the NIBs compiled from the storyboard?



Application Specific Information:

*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named _UITextLayoutView because no class named _UITextLayoutView 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)'

abort() called

terminating with uncaught exception of type NSException


Application Specific Backtrace 1:

0 CoreFoundation 0x000000010b99bf43 __exceptionPreprocess + 250

1 libobjc.A.dylib 0x000000010a0a3835 objc_exception_throw + 48

2 CoreFoundation 0x000000010b99bd99 +[NSException raise:format:] + 189

3 UIFoundation 0x000000011805bc64 UINibDecoderDecodeObjectForValue + 360

4 UIFoundation 0x000000011805bfe4 UINibDecoderDecodeObjectForValue + 1256

5 UIFoundation 0x000000011805baef -[UINibDecoder decodeObjectForKey:] + 251

6 UIKitCore 0x0000000113e120aa -[UIView initWithCoder:] + 1030

7 UIKitCore 0x0000000113e2bf52 -[UIScrollView initWithCoder:] + 65

8 UIKitCore 0x0000000114b4c160 -[UITextView initWithCoder:] + 65

9 UIFoundation 0x000000011805bde7 UINibDecoderDecodeObjectForValue + 747

10 UIFoundation 0x000000011805bfe4 UINibDecoderDecodeObjectForValue + 1256

11 UIFoundation 0x000000011805baef -[UINibDecoder decodeObjectForKey:] + 251

12 UIKitCore 0x0000000113e120aa -[UIView initWithCoder:] + 1030

13 UIFoundation 0x000000011805bde7 UINibDecoderDecodeObjectForValue + 747

14 UIFoundation 0x000000011805bfe4 UINibDecoderDecodeObjectForValue + 1256

15 UIFoundation 0x000000011805baef -[UINibDecoder decodeObjectForKey:] + 251

16 UIKitCore 0x0000000113e120aa -[UIView initWithCoder:] + 1030

17 UIKitCore 0x0000000113e0f212 -[UIClassSwapper initWithCoder:] + 2511

18 UIFoundation 0x000000011805bde7 UINibDecoderDecodeObjectForValue + 747

19 UIFoundation 0x000000011805bfe4 UINibDecoderDecodeObjectForValue + 1256

20 UIFoundation 0x000000011805baef -[UINibDecoder decodeObjectForKey:] + 251

21 UIKitCore 0x0000000113e120aa -[UIView initWithCoder:] + 1030

22 UIFoundation 0x000000011805bde7 UINibDecoderDecodeObjectForValue + 747

23 UIFoundation 0x000000011805bfe4 UINibDecoderDecodeObjectForValue + 1256

24 UIFoundation 0x000000011805baef -[UINibDecoder decodeObjectForKey:] + 251

25 UIKitCore 0x0000000113e120aa -[UIView initWithCoder:] + 1030

26 UIFoundation 0x000000011805bde7 UINibDecoderDecodeObjectForValue + 747

27 UIFoundation 0x000000011805baef -[UINibDecoder decodeObjectForKey:] + 251

28 UIKitCore 0x0000000114c059b7 -[UILayoutGuide initWithCoder:] + 120

29 UIFoundation 0x000000011805bde7 UINibDecoderDecodeObjectForValue + 747

30 UIFoundation 0x000000011805baef -[UINibDecoder decodeObjectForKey:] + 251

31 Foundation 0x0000000106880e81 -[NSLayoutConstraint initWithCoder:] + 145

32 UIFoundation 0x000000011805bde7 UINibDecoderDecodeObjectForValue + 747

33 UIFoundation 0x000000011805baef -[UINibDecoder decodeObjectForKey:] + 251

34 UIKitCore 0x0000000113e0e626 -[UIRuntimeConnection initWithCoder:] + 160

35 UIFoundation 0x000000011805bde7 UINibDecoderDecodeObjectForValue + 747

36 UIFoundation 0x000000011805bfe4 UINibDecoderDecodeObjectForValue + 1256

37 UIFoundation 0x000000011805baef -[UINibDecoder decodeObjectForKey:] + 251

38 UIKitCore 0x00000001145eba2c -[NSCoder(UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:forKey:] + 450

39 UIKitCore 0x0000000113e0cc63 -[UINib instantiateWithOwner:options:] + 1146

40 UIKitCore 0x0000000113e2b8fe -[UIViewController _loadViewFromNibNamed:bundle:] + 395

41 UIKitCore 0x0000000113e2b64a -[UIViewController loadView] + 177

42 UIKitCore 0x0000000113e2a1b5 -[UIViewController loadViewIfRequired] + 172

43 UIKitCore 0x0000000113e3e99a -[UIViewController view] + 27

44 UIKitCore 0x0000000113e93fa3 -[UIWindow addRootViewControllerViewIfPossible] + 156

45 UIKitCore 0x0000000114918ebb -[UIWindow _updateLayerOrderingAndSetLayerHidden:actionBlock:] + 210

46 UIKitCore 0x0000000113e93116 -[UIWindow _setHidden:forced:] + 361

47 UIKit 0x0000000132277ade -[UIWindowAccessibility _orderFrontWithoutMakingKey] + 86

48 UIKitCore 0x0000000114922c97 -[UIWindow _mainQueue_makeKeyAndVisible] + 42

49 UIKitCore 0x0000000114a9b6d2 -[UIWindowScene _makeKeyAndVisibleIfNeeded] + 202

50 UIKitCore 0x000000011404f7d7 +[UIScene _sceneForFBSScene:create:withSession:connectionOptions:] + 1435

51 UIKitCore 0x00000001148f263d -[UIApplication _connectUISceneFromFBSScene:transitionContext:] + 1043

52 UIKitCore 0x0000000113df8810 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 327

53 UIKitCore 0x0000000113df8642 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361

54 FrontBoardServices 0x00000001266e2085 -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 453

55 FrontBoardServices 0x00000001266ffbfa __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.156 + 102

56 FrontBoardServices 0x00000001266eacbd -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220

57 FrontBoardServices 0x00000001266ff88d __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 354

58 libdispatch.dylib 0x000000010c0d350e _dispatch_client_callout + 8

59 libdispatch.dylib 0x000000010c0d5c21 _dispatch_block_invoke_direct + 245

60 FrontBoardServices 0x00000001266d21c5 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30

61 FrontBoardServices 0x00000001267187e9 -[FBSSerialQueue _queue_performNextIfPossible] + 441

62 FrontBoardServices 0x00000001266d215f -[FBSSerialQueue _performNextFromRunLoopSource] + 22

63 CoreFoundation 0x000000010b907b71 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

64 CoreFoundation 0x000000010b907b10 __CFRunLoopDoSource0 + 103

65 CoreFoundation 0x000000010b8eb104 __CFRunLoopDoSources0 + 209

66 CoreFoundation 0x000000010b8ea710 __CFRunLoopRun + 1272

67 CoreFoundation 0x000000010b8e9f93 CFRunLoopRunSpecific + 499

68 HIToolbox 0x0000000116922a0d RunCurrentEventLoopInMode + 292

69 HIToolbox 0x0000000116922659 ReceiveNextEventCommon + 356

70 HIToolbox 0x00000001169224d7 _BlockUntilNextEventMatchingListInModeWithFilter + 64

71 AppKit 0x000000010a0fdd24 _DPSNextEvent + 990

72 AppKit 0x000000010a0fca94 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352

73 AppKit 0x000000010a0f7234 -[NSApplication run] + 658

74 AppKit 0x000000010a0e90dd NSApplicationMain + 777

75 AppKit 0x000000010a5688a4 _NSApplicationMainWithInfoDictionary + 16

76 UIKitMacHelper 0x000000011613d2b1 UINSApplicationMain + 322

77 UIKitCore 0x0000000113de2004 UIApplicationMain + 2206

7

Answered by DTS Engineer in 391940022

This is an issue we are aware of. Please see this other thread for more discussion, including things you can do to avoid this.

My project compiled and ran without any crashes yesterday using XCode 11.1. I updated to XCode 11.2 today and now my build crashes with this exact error. Please let me know if you find a solution.

Same here! It happens in iOS 11.0.1 when I test. No problem on iOS 13. I think there's something to do with UITextView. The app crashes only when I try to open a screen with a TextView. The TextView is added via Storyboard. No problems if I add it via code.

I ran into the same problem, the app will crash on any version before iOS 13.2, which include 13.1.2

I am also facing same issue. It suddently started crashing in real device.

Same problem after Xcode update to 11.2

Also having the same issue. Now completely blocked.

I'm only seeing crashes on my custom UITextView on my (devices) iPad Pro and iPhone X but it runs fine on my iPhone 7. Simulator works fine on all.

Looks like we need to wait for Xcode 11.2.1. Hopefully this will happen soon.

I have tryed yoru solution but the app crashes in any case

Same issue as this one: https://forums.developer.apple.com/thread/125287

If you run on iOS 13.2 simulator it won't crash but I try a older IOS Simulator like 11.4 it will crash as above (Xcode 11.2).

No problems with Xcode 11.1 other than debuging wont work with iOS 13.2 devices.

I can confirm that replacing my Storyboard based UITextView with one programatically generated no longer crashes.


See this SO thread for more details.

Accepted Answer

This is an issue we are aware of. Please see this other thread for more discussion, including things you can do to avoid this.

that other thread suggests using Xcode 11.1 but I had the problem originally with 11.1, so that won't help.


Taking views out of storyboards is a major PITA: you'll have to recreate a lot of constraints, that might vary by traits, etc... InterfaceBuilder would really benefit from a "replace view with" that would let you swap, for instance, an UITextView with a UIView while keeping the same size and constraints.

Bummer, just faced this issue. Might it be that we are all running the latest MacOS but the reviewers are not?

well, they definitely had a different build number for 10.15.1 than I have. Anyway, if it crashes on 10.15.0 is not good.

App crashing only when submitting it for review (NSInvalidUnarchiveOperationException)
 
 
Q