App was crashing in xcode 16 due to Quicklook UI framework

QLPreviewView was used in the app to display the file previews. But the following crash was happening.

Date/Time: 2024-09-13 22:03:59.056 +0530 OS Version: Mac OS X 10.13.6 (17G14042) Report Version: 12 Anonymous UUID: 7CA3750A-2BDD-3FFF-5940-E5EEAE2E55F5

Time Awake Since Boot: 4300 seconds

System Integrity Protection: disabled

Notes: Translocated Process

Crashed Thread: 0

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: DYLD, [0x1] Library missing

Application Specific Information: dyld: launch, loading dependent libraries

Dyld Error Message: Library not loaded: /System/Library/Frameworks/QuickLookUI.framework/Versions/A/QuickLookUI Referenced from: /private/var/folders/*/Notebook (Beta).app/Contents/MacOS/Notebook (Beta) Reason: image not found

@sekharfromIndia 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.

When the app was build through Xcode 16RC the app was crashed in the devices macOS version having macOS 10.13, 10.14, 10.15. If the app was build through Xcode 15 the app was working fine in all the devices.

The crash report says QuicklookUI framework not found. As a part of testing, I commented all the code which uses QuicklookUI API's and the App was running fine in all the devices.

Now, the issue is why the App was building fine in Xcode 15 and not in Xcode 16. Please find the below crash report.

@DTS Engineer Seeing the exact same behavior here. App crashes with "Dyld Error", "Library not found: QuickLookUI" on macOS 10.15 if compiled with Xcode 16 on Sequoia, but works fine if compiled with Xcode 15 on Sonoma.

FB15139430

It seems it's not just macOS 10.15, it's also Big Sur. In fact, it's not about the macOS version - it's crashing on Intel Macs. We've just received a crash report from Big Sur with the same issue:

Code Type: X86-64 (Native)
Parent Process: ??? [1]
User ID: 501

Date/Time: 2024-09-18 12:48:44.261 +0700
OS Version: macOS 11.7.10 (20G1427)
Report Version: 12
Anonymous UUID: FCCC50AB-71DC-4908-AD86-EE79F2A7EDFF

Sleep/Wake UUID: FA9BC3F4-1F95-41BC-9153-EA509922FCFB

Time Awake Since Boot: 44000 seconds
Time Since Wake: 18000 seconds

System Integrity Protection: enabled

Crashed Thread: 0

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
   dyld: Using shared cache: 3694F5E4-3E85-3CD5-A2B0-534E2DFC1355
Library not loaded:
/System/Library/Frameworks/QuickLookUI.framework/Versions/A/QuickLookUI
   Referenced from:

I use the bear notes app and it was unable to open suddenly two days ago. Got the same crash report, so I went looking for QuickLookUI, it's missing from that directory. Im on an intel mac too.

@DTS Engineer

Any update on this?

In Recent macOS 15.1 Beta 5 Release date, It was mentioned that it was a known issue.

Was this going to be fixed or we have to look any alternatives?

Please provide the information

@DTS Engineer Having the same problem here: building an app on Xcode 16.0 on macOS Sonoma 14.7 results in an application that crashes on macOS Big Sur Intel machine with the same crash as mentioned above.

Building with Xcode 15.4 does not have this issue. However, we cannot build this branch on Xcode 15.x anymore due to code changes for Xcode 16 compatibility.

Is there a workaround? We're now stuck in an unreleasable state!

We are having the same crash under BigSur when our app is built with Xcode 16. Going back to building with Xcode 15.4 under macOS 14.5 Sonoma fixes the problem.

Same here: apps built with the GM version of Xcode 16 crash on Intel Macs because the QuicklookUI framework is not loaded.

It's really inexcusable that this made it to the production release of Xcode 16. It was reported (AND ACKNOWLEDGED!) in the beta period and nobody at Apple Engineering cared enough to do anything about it.

We PAY for this. Apple loves to brag about how the 30% fee it collects goes to support APIs and the platforms. Really? Does it? Does anyone here feel supported?

FIX THE BUG, Apple.

You can easily fix this yourself, just add QuickLookUI to your linked frameworks and set it to optional:

https://community.folivora.ai/t/bettertouchtool-will-not-launch/38688/4?u=andreas_hegenberg

Including QuickLookUI as optional does not work. The app no longer crashes but QuickLook functionality does not work.

The only true workaround seems to be building on Sonoma with Xcode 15.x.

Does anyone know if this has been addressed in Xcode 16.1?

After adding quicklookui as optional, the problem is solved partialy: the app starts under older macOS but the QuickLook functionality is not available - even after linking quicklook in addition to quicklookui

I got tired of booting into Sonoma to build. It's bad enough I have to boot into Monterey to get a 10.10,11,12 capable build.

I've created a small app (~184k) which does nothing except manage the preview panel. The app has no menu or dock icon. I've built the app on Monterey but any OS other than Sequoia will do. I include the helper app in my main app's bundle. My main app communicates with the helper via a custom URL scheme.

It took about 5 minutes to change the code in my main app. I no longer include the Quartz or Quicklook frameworks in my project. Simply removing the Quicklook framework will not work if Quartz is referenced. I can now build on Sequoia and the app runs on every OS I support.

The only different behaviour is that if you do a ⌘Q while the preview panel has the focus, it will not terminate the main app. I could more than likely get around this but the main app terminates the helper when terminated and it's not worth the effort.

If you build your app on Monterey, you don't need any helpers or tricks. An app compiled on macOS Sonoma or earlier (eg Monterey) supports QuickLook correctly on any macOS from High Sierra to Sequoia (inclusive). The problem is in building an app on Sequoia and Xcode 16 to work with QL on macOS BigSur and earlier.

To handle this issue, I had to install Sonoma with Xcode 15.4 on another volume. So now I'm developing in Sequoia/Xcode 16 but need to reboot to Sonoma/Xcode 15.4 in order to build and distribute (as I want to support 10.15+). Not perfect solution at all, but it may allow me to survive until this issue is fixed, as I release every 2-3 months.

App was crashing in xcode 16 due to Quicklook UI framework
 
 
Q