Preview crashes consistency in Xcode 16 beta

In the first Xcode 16 beta, none of my SwiftUI previews work - they all just crash on start up.

Has anybody run into this and found a workaround? Have tried all the usual steps of cleaning the project/restarting Xcode.

Answered by Developer Tools Engineer in 790083022

Hi,

Sorry to hear you are having problems getting previews working. The best next step will be to file a feedback with diagnostics so we can take a look.

Steps to generate helpful diagnostics:

  1. Download and install the logging profile on all devices involved. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift
  2. Reproduce the issue
  3. Click the "Diagnostics" button in the error banner in Previews' Canvas area (or if the banner is missing you can use the menu: Editor > Canvas > Diagnostics)
  4. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  5. Attach (or make from the folder) the resulting zip file to the bug report (will be named something like previews-diagnostics-0123456789.zip)
  6. Generate the sysdiagnose(s) and attach those too

Hi,

Sorry to hear you are having problems getting previews working. The best next step will be to file a feedback with diagnostics so we can take a look.

Steps to generate helpful diagnostics:

  1. Download and install the logging profile on all devices involved. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift
  2. Reproduce the issue
  3. Click the "Diagnostics" button in the error banner in Previews' Canvas area (or if the banner is missing you can use the menu: Editor > Canvas > Diagnostics)
  4. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  5. Attach (or make from the folder) the resulting zip file to the bug report (will be named something like previews-diagnostics-0123456789.zip)
  6. Generate the sysdiagnose(s) and attach those too

I'm also running into this issue. If I go into the diagnostics for the previews I see that the error is LLVMError(description: "Failed to materialize symbols. I didn't see any other relevant results for this error on Google.

I've submitted feedback. The ID is FB13841857

Yep this is the same error I'm seeing.

I'm also running into this issue. If I go into the diagnostics for the previews I see that the error is LLVMError(description: "Failed to materialize symbols. I didn't see any other relevant results for this error on Google.

Same issue for me, none of my previews work.

Most of my Xcode previews are crashing very often on Xcode 16 beta. I receive the following errors:

  • Fatal Error in UVJITAgent.swift: Failed linking pseudodylib <path> during initial JIT link. dlopen(<path>, 0x0002): Library not loaded: /System/Library/Frameworks/_ClockKit_SwiftUI.framework/_ClockKit_SwiftUI
  • LLVMError(description: "Duplicate definition of symbol ...")
  • AppCannotRunOnTargetDestination: This app cannot run on the selected target device.

I can get all previews to work by performing an incremental build and resuming the preview. Sometimes, I have to repeat this process multiple times. As soon as I switch to another view, the errors return.

I've submitted a feedback report and attached diagnostics for all errors (FB13865079).

Same issue here (FB13861460). A fresh project works just fine, so it appears to be something specific to how my project is set up. I can't read anything useful from the error log, though.

Thanks for the feedbacks. We are triaging these as fast as we can.

So far it seems there are a few different issues that are being hit, so it's great that y'all keep filing!

In my case I got LLVMError(description: "file too small to be an archive")

When I created a new project it worked fine at first , then when I added the SPM I was using in the old project the preview in the new one started getting the same error as well

I had some other SPMs in the main one , I started added them 1 by 1 so all worked fine except ios-places-sdk and ios-maps-sdk

So apparently the problem for me is there.

What ended up "solving" this for me, was removing all of my third party Swift packages that I imported.

It didn't appear to be any particular package that caused it, as removing them one at a time made no difference - it was just the presence of any packages that seemed to upset it.

I had talk with apple in their lab sessions and they admitted it's known issue in first beta and wait for next betas to have fix

I removed the Firebase SDK, which I was integrating through Swift Package Manager (SPM), and now the Previews are working again.

Also seeing this issue. I was getting these two errors in different projects:

Nothing in the project was calling NSApplication.shared, and building/running the app worked fine...

I started removing every single linked framework and source file except one, and made a simple Preview containing a Color.red, and now my Preview won't even load at all:

I`m with this problem

An easy workaround is:

Editor -> Canvas -> Enable Legacy Previews Execution.

It's not a fix, but it allows you to run previews while updating your views to Swift 6.

37

I can confirm that removing Firebase from my Packages fixed the issue for me.

Preview crashes consistency in Xcode 16 beta
 
 
Q