iOS 18.1 crash UIHostingView.layoutSubviews() / swift_unknownObjectWeakAssign / objc_storeWeak

We're seeing sporadic crashes on devices running iOS 18.1 - both beta and release builds (22B83). The stack trace is always identical, a snippet of it below. As you can tell from the trace, it's happening in places we embed SwiftUI into UIKit via UIHostingController.

Anyone else seeing this?

4 libobjc.A.dylib 0xbe2c _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 30

5 libobjc.A.dylib 0xb040 weak_register_no_lock + 396

6 libobjc.A.dylib 0xac50 objc_storeWeak + 472

7 libswiftCore.dylib 0x43ac34 swift_unknownObjectWeakAssign + 24

8 SwiftUI 0xeb74c8 _UIHostingView.base.getter + 160

9 SwiftUI 0x92124 _UIHostingView.layoutSubviews() + 112

10 SwiftUI 0x47860 @objc _UIHostingView.layoutSubviews() + 36

Take a look at the documentation for debugging techniques that has guidance on debugging common reasons for a crash. If you get stuck, let us know what you tried, and attach the fully symbolicated Apple crash report in your reply. Posting a Crash Report explains how to do so.

Full stack trace attached. Haven't been able to reproduce. This is a widespread issue across our app. Again, only seeing on iOS 18.1, no other iOS versions.

iOS 18.1 crash UIHostingView.layoutSubviews() / swift_unknownObjectWeakAssign / objc_storeWeak
 
 
Q