app crashes updating to Xcode 11.2 from 11.1

This thread has been locked by a moderator; it no longer accepts new replies.

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.

Answered by DTS Engineer in 392605022

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.

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 ?

Everyone experiencing this has filed bugs, right?

That was a beta ?


Did you try with 11.2 release version ?

same here - crashes on a device running 13.1 but works fine on a device running 13.2

You can work around it by making the TextView via code and not using IB. At least worked for me.


But it doesn't look like a nice solution and I would wait for new Xcode release

Does it occur with TextView or TextField or both ?

Creatign the UITextView in code helped me

Cant easily switch from storyboard/XIB to code, our storyboard has tons of view that use tons of UITextViews, would take many days to convert that.


Guess my only option will be to downgrade to XCode 11.1 which then of couse has the problem that we can't use our test devices that were already upgraded to 13.2. I was eagerly wating this XCode update since we had already a few devices auto-update to the latest and it took way to long for the XCode update to follow up.


Hope this fix by Apple does not take too long since every workaround screws us in some way.

Do file a bug. The more will report the problem, the higher chance to get it fixed faster.

We are seeing the same crash after upgrading to XCode 11.2.


The only solution we have found so far is to replace UITextViews with UIViews in XIBs, and add UITextViews into those UIViews at runtime in code.

Same here happening with UITextView declared in XIBs. Working perfectly on iOS 13.2 and crashing with the previous version. The only workaround I found was to create the UITextView in the viewDidLoad().

app crashes updating to Xcode 11.2 from 11.1
 
 
Q