app crashes updating to Xcode 11.2 from 11.1

This thread has been locked by a moderator.

My app ran without any crashes while using Xcode 11.1. After updating to XCode 11.2, my app experienced a crash:


*** 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)'


This crash seems to occur during a perpare for seque, before any of my views appear on the screen.


Any idea on the cause or solution?


Thanks.

Up vote post of shirefriendship
54k views

Accepted Reply

This is addressed in the GM Seed of Xcode 11.2.1. If you are writing a Mac Catalyst app, please also see the release notes for Xcode 11.2.1.


For any other issues you encounter while using Xcode, please file bug reports.

Replies

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'm getting the same error when I upgraded to Xcode 11.2 (11B52) and try to access a view that have a Text View. The Text View was created in Interface Builder. My app run just fine on the iOS Simulators though. A solution to this problem will be greatly appreciated. Until then I'm unable to test the Text View's code on my physical devices.

Having the same issue here. Works on iOS 13, crashes on iOS 12 and below.

Would be interesting if someone on this thread did a computer restart to see if it helps this issue...

Same here.

Crashes on a view with UITextView in hierarchy.

Crashes on every iOS except the latest 13.2.

same here. what the ??

Does it occur on simulator and / or device.


code generated with 11.2 beta2

simulator IOS13.2 (11 Pro)

device iPhone XS 13.1.3


Tested on both simulator and device.

I have several views with UITextField, no crash, not problem detected so far.


Repeated the test with XCode 11.1, on iPhone Xs 13.1.3.

No problem either.

I was using custom textview


class CustomTextView : UITextView, UITextViewDelegate {
  
    var textChanged : ((String)->())?
  
    init(frame: CGRect) {
        super.init(frame: frame, textContainer: nil)
        self.initialize()
    }
  
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.initialize()
    }
   }

But is crashing on


aDecoder: NSCoder method

issue is with custom textviews

UITextView in interface builder

build with Xcode11.2

crash before iOS13.2, both simulator and devices.

This is not related to Swift. I am not using any Swift and it still crashes in the same way.

Time to go back to Xcode 11.1 and wait for 11.2.1

It occurs on device and simulator with iOS <13.2. On 13.2 everything is ok.

Built with XCode 11.2 from App Store (11B52)


With 'All Exceptions' breakpoint XCode catches a line where it tries to load a view from .xib which has UITextView as subview (connected as IBOutlet).

Then I get:


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)'


Here's a top of the stack trace:

0 CoreFoundation 0x000000010a71e1bb __exceptionPreprocess + 331

1 libobjc.A.dylib 0x0000000109b3d735 objc_exception_throw + 48

2 CoreFoundation 0x000000010a71e015 +[NSException raise:format:] + 197

3 UIFoundation 0x0000000111abb427 UINibDecoderDecodeObjectForValue + 359

4 UIFoundation 0x0000000111abb854 UINibDecoderDecodeObjectForValue + 1428

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

6 UIKitCore 0x00000001181aa405 -[UIView initWithCoder:] + 886

7 UIKitCore 0x000000011814d4a6 -[UIScrollView initWithCoder:] + 71

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

9 UIFoundation 0x0000000111abb5ad UINibDecoderDecodeObjectForValue + 749

10 UIFoundation 0x0000000111abb854 UINibDecoderDecodeObjectForValue + 1428

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

12 UIKitCore 0x00000001181aa405 -[UIView initWithCoder:] + 886

I fear you're right.


May be even have to wait for 11.3.

We are running into the same issue at the moment with Xcode 11.2.

Custom, you mean subclassed ?