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.

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

Seeing similar. SPM previews work—when selecting appropriate scheme—but main app previews don't, failing to launch with very unhelpful message.

Tried all the usual resets, cache deletions, restarts and rebuilds, to no avail.

Have filed FB13954069 with report and diagnostics.

I am using Xcode 16 beta 2, I am still having issue with preview crashed, there's no problem with Xcode 15. kind Regard.

This seems to be fixed in beta 3.

same issue Xcode 16 beta 5

In Xcode 16.1 beta, live preview fails in large (scheme) project, even for the simplest view such as hello world text. It takes very long time to build the view and eventually report over 15 seconds time limit.

I am pretty the such a simple view doesn't have reference to any other project files.

However, if I copy the view into a fresh created project, the live preview works.

This situation also applies to the live preview on device.

Same issue here. Previews crash on 16.0 beta 6 and 16.1 beta 1. Enabling "Editor -> Canvas -> Use Legacy Previews Execution" causes previews to start working again.

Thanks, the Use Legacy Previews Execution worked for me too. I have been stuck using Xcode 15, but this option seems to make Xcode 16 workable.

I'm getting a JITError: Runtime linking failure error with the 16.0 release. Only 1 SwiftUI view so far. Use Legacy Previews Execution is working so far.

import SwiftUI

struct Dashboard: View {
    var body: some View {
        Text("hello")
    }
}

#Preview {
    Dashboard()
}

Getting an different error than I've seen reported here in both Xcode 16.0 and 16.1 beta 2 (without Legacy Previews): "Cannot preview in this file. Implicitly unwrapped nil value in GeneratedAssetSymbols.swift"

I've performed the reporting requested and submitted a feedback: FB15176682

One of my projects crashes consistently every few minutes in Xcode 16.0 so I set it to legacy preview. Keywords in case anyone else googles for the problem:

AccessibilityControlsExtension Responsible Process: SimulatorTrampoline

Preview crashes consistency in Xcode 16 beta
 
 
Q