SwiftUI crash on macOS 10.13 and 10.14

Hi there,

My macOS AppKit/Cocoa app uses Swift and Objective-C, however I'm not using SwiftUI anywhere.

Customers launching the app now receive an instant crash due to dyld not being able to locate SwiftUI:

Library not loaded: /System/Library/Frameworks/SwiftUI.framework/Versions/A/SwiftUI

Again, not using SwiftUI anywhere in my app, cannot find any project references in Xcode that mention SwiftUI -
yet checking the generated binary with otool reveals that my app indeed appears to link against SwiftUI.

Any idea what happened..?

Thanks,
Jay

Replies

This bug occurs with Xcode 15.2 and 15.3.

The same project compiled with Xcode 14.2 (14C18) on macOS 12.7.4 creates a binary that does not reference SwiftUI, all good and as expected.

No idea why Xcode thinks that SwiftUI is required.
The word SwiftUI occurs exactly twice in my build log, both:

export LOCALIZED_STRING_SWIFTUI_SUPPORT\=YES

This Xcode bug is known and has been reported in Aug 2023…

https://github.com/apple/swift/issues/68163