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

+1 Had to enable Use Legacy Previews Execution to get it to work.

Enabling legacy previews fixed this for me too.

Posted in July, and filed Feedback about it with Apple.

After some back and forth they said **"Thank you so much for providing the built products! We’ve identified that object files for this project are built as universal. There’s a known issue with the new Previews execution mode that projects built in debug mode as universal can run into this exact error. We’re working on a fix.

But in the meantime can you check your scheme build settings? Open up the scheme editor by choosing the “Product > Scheme > Edit Scheme” menu item. Click on the “Build” sidebar tap in the modal window. You should see a control in the middle labeled Override Architectures. We’re pretty sure you have yours set to Universal. If you set that to “Match Run Destination” then your debug build products will just focus on building the architecture that you’re targeting to build-and-run. That should be sufficient! Please let us know if now.

Note that this only affects local development. If you archive or submit to the app store all the architectures you are targeting will be built as usual."**

This has certainly made it more stable for me…

I'm getting the following error:

XOJITError: Failed to materialize symbols: { (Program, { ___dso_handle, ___mh_executable_header }) }

This is the SwiftUI Turtlerock Tutorial.

When I try to upload the zipped Diagnostics file, it is greyed out and cannot be selected,

Had the same problem with Firebase packages causing a crash in Xcode 16 26.4 beta and setting Editor -> Canvas -> Use Legacy Previews Execution fixed it.

Preview crashes consistency in Xcode 16 beta
 
 
Q