"TranslationUnit" - Xcode Previews constantly crash in Xcode 16 Beta 1

Hey,

I've opened an existing project with Xcode 16 Beta 1 (I'm also running macOS Sequoia).

None of my previews work anymore. They simply crash with an error I don't quite understand:

JITError
    
    ==================================
    
    |  NoBuiltTargetDescriptionCouldBeFound
    |  
    |  translationUnit: PreviewTranslationUnit(moduleNamePrefix: "Previews_ErrorView", sourceIdentifier: file:///Users/dennis/Code/Project/Project/Components/ErrorView.swift -> ErrorView.swift, parseTree: ParseTree(version: 1848, statements: 5, providers: 0), update: nil, changesContextMemoizer: PreviewsPipeline.PreviewTranslationUnit.(unknown context at $3561fdc4c).ChangesContextMemoizer(parseTree: ParseTree(version: 1848, statements: 5, providers: 0), sourceIdentifier: file:///Users/dennis/Code/Project/Project/Components/ErrorView.swift -> ErrorView.swift, cachedValue: os.OSAllocatedUnfairLock<Swift.Optional<PreviewsModel.ParseTree.PreviewChangesContext>>(__lock: Swift.ManagedBuffer<Swift.Optional<PreviewsModel.ParseTree.PreviewChangesContext>, __C.os_unfair_lock_s>)), registryDeclarationMemoizer: PreviewsPipeline.PreviewTranslationUnit.(unknown context at $3561fdbec).RegistryDeclarationMemoizer)
    |  
    |  builtTargetDescriptions:

The app builds and runs fun on a simulator and on device.

Any ideas what this error means? Is this just an early Beta 1 bug or might there be anything I can do in my project to fix this?

The WWDC24 demo projects all work fine and their previews are working as well.

Thanks!

Answered by Developer Tools Engineer in 790082022

Hi Quantm

Sorry to hear you are having problems getting previews working in beta 1.

We will need more diagnostics to troubleshoot the problem you are seeing. It would be great if you could 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 Quantm

Sorry to hear you are having problems getting previews working in beta 1.

We will need more diagnostics to troubleshoot the problem you are seeing. It would be great if you could 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

Hey,

thanks for the reply :)

I just started Xcode Beta back up to try and reproduce the issue but now the Previews all work fine. I couldn't make them crash again.

I have no idea what changed, I restarted Xcode multiple times yesterday but it kept crashing. Sorry that I cannot provide you with a potentially helpful diagnostics now. I'm going to install the profile nonetheless and try to generate and send you a report whenever the error occurs again.

Good that it is working at least. If you do end up reproducing the issue again and filling a feedback, reply to this thread with the feedback ID. Thank!

Hey, good news, I guess 😅 The previews have started crashing again.

I've filed a feedback with the report and the sysdiagnose. Hope it helps 🙂

Feedback ID: FB13847416

"TranslationUnit" - Xcode Previews constantly crash in Xcode 16 Beta 1
 
 
Q