FB14667312: Breaking - Invalid Binaries for macOS Apps Using QuickLook in Xcode 16 Beta
- Date: 2024-08-05
- Resolution: Potential fix identified - For a future OS update
- Area: Xcode
- OS: macOS
- Type: Incorrect/Unexpected Behavior
- Keywords: xcode, linking, linker, crash, quicklook, quicklookui, framework
Details
What version of Xcode are you using?
Xcode Version 16.0 beta 4 (16A5211f)
Did you see an error message?
Yes
What was the error?
Dyld Error Message - Library not loaded: /System/Library/Frameworks/QuickLookUI.framework/Versions/A/QuickLookUI
What devices were you using when the issue occurred?
Mac
When did the issue most recently occur?
2024-08-05T15:31:06+02:00
Description
Xcode 16 beta produces invalid binaries for macOS apps using QuickLook when targetting macOS 11 BigSur or earlier. The produced apps crash at launch on macOS 11 and earlier due to an incorrect path for the QuickLookUI framework, with the following error:
Dyld Error Message:
Library not loaded: /System/Library/Frameworks/QuickLookUI.framework/Versions/A/QuickLookUI
Reason: image not found
On macOS 11 and earlier, QuickLookUI is located inside the Quartz framework. Thus, an app targeting these versions should link to:
/System/Library/Frameworks/Quartz.framework/Versions/A/Quartz
Xcode 15.4 handles this correctly. However, Xcode 16 beta incorrectly links directly to:
/System/Library/Frameworks/QuickLookUI.framework
This issue causes all apps using QuickLook to crash on macOS 11 and earlier when built with Xcode 16.
Attached is an Xcode project demonstrating the issue. QuickLookUI is imported from a Swift file as such:
import QuickLookUI
Two binaries built from this project are also attached. One is built with Xcode 15.4, the other with Xcode 16 beta 4.
You can see the linking difference using:
otool -L QLTestApp-Xcode-15
otool -L QLTestApp-Xcode-16
QLTestApp-Xcode-15 (architecture x86_64):
/System/Library/Frameworks/Quartz.framework/Versions/A/Quartz (compatibility version 1.0.0, current version 1266.4.2)
QLTestApp-Xcode-15 (architecture arm64):
/System/Library/Frameworks/Quartz.framework/Versions/A/Quartz (compatibility version 1.0.0, current version 0.0.0)
QLTestApp-Xcode-16 (architecture x86_64):
/System/Library/Frameworks/QuickLookUI.framework/Versions/A/QuickLookUI (compatibility version 1.0.0, current version 0.0.0)
QLTestApp-Xcode-16 (architecture arm64):
/System/Library/Frameworks/QuickLookUI.framework/Versions/A/QuickLookUI (compatibility version 1.0.0, current version 0.0.0)
Files
The issue is still present in Xcode 16 beta 6 (16A5230g).
The issue is still present in Xcode 16 RC (16A242).
The issue is still present in the final version of Xcode 16.
This is a significant issue since we can no longer build our apps with the current version of Xcode. It also means we cannot update to macOS Sequoia since Xcode 15 doesn't run, which is a major problem for my company.
Please fix this.