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

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

+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…

Preview crashes consistency in Xcode 16 beta
 
 
Q