Xcode previews fail with JIT error

== PREVIEW UPDATE ERROR:

JITError

==================================

|  NoBuiltTargetDescriptionCouldBeFound
|  
|  translationUnit: PreviewTranslationUnit(moduleNamePrefix: "Previews_EmptyFeedRow", sourceIdentifier: file:///Users/bryananderson/Developer/JournalApp/JournalApp/Interface/Feed/EmptyFeedRow.swift -> EmptyFeedRow.swift, parseTree: ParseTree(version: 727, statements: 3, providers: 1), update: nil, changesContextMemoizer: PreviewsPipeline.PreviewTranslationUnit.(unknown context at $34b4b9c4c).ChangesContextMemoizer(parseTree: ParseTree(version: 727, statements: 3, providers: 1), sourceIdentifier: file:///Users/bryananderson/Developer/JournalApp/JournalApp/Interface/Feed/EmptyFeedRow.swift -> EmptyFeedRow.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 $34b4b9bec).RegistryDeclarationMemoizer)
|  
|  builtTargetDescriptions:
|  

== VERSION INFO:

Tools: 16A5171c
OS:    24A5264n
PID:   906
Model: MacBook Pro
Arch:  arm64e

== ENVIRONMENT:

openFiles = [
    /Users/bryananderson/Developer/JournalApp/JournalApp/Interface/Feed/EmptyFeedRow.swift
]
wantsNewBuildSystem = true
newBuildSystemAvailable = true
activeScheme = JournalApp
activeRunDestination = iPhone 15 Pro variant iphonesimulator arm64
workspaceArena = [x]
buildArena = [x]
buildableEntries = [
    Remember.app
]
runMode = JIT Executor

== SELECTED RUN DESTINATION:

name = iPhone 15 Pro
eligible = true
sdk = Optional(<DVTSDK:0x13870da30:'iphonesimulator18.0':Simulator - iOS 18.0:<DVTFilePath:0x600001e8c700:'/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.0.sdk'>>)
variant = Optional("iphonesimulator")
device = Optional(<DVTiPhoneSimulator: 0x32f00d290> {
		SimDevice: iPhone 15 Pro (CF3C85BC-F559-4437-9072-7F30153B399B, iOS 18.0, Booted)
			PairedSim: <DVTiPhoneSimulator: 0x33733d150> {
		SimDevice: Apple Watch Series 9 (45mm) (627CE93E-EB02-4200-BE40-3DCB5C91DB44, watchOS 11.0, Shutdown)
}
})

== SELECTED RUN DESTINATION:

Simulator - iOS 18.0 | iphonesimulator | arm64 | iPhone 15 Pro | Apple Watch Series 9 (45mm)
jit enabled: true
fallback to dynamic replacement: false

CrashReportError: Fatal Error in UVJITAgent.swift

App crashed due to fatalError in UVJITAgent.swift at line 58.

JIT linker connection terminated due to remote disconnect

Same here. This is awful

Can you try again with Xcode 16 Beta 2 that came out recently and let us know how it goes?

I just updated to Xcode 16 beta 3. A very simple Mac app I developed in beta 2 that previewed successfully just prior to the Xcode upgrade has started crashing on preview with the "fatalError in UVJITAgent.swift" message. It builds and runs successfully. It's only a problem previewing the app's one view.

Create empty project with type App in MacOS Sequoia in Xcode 16 beta 3

import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("abcdef")
    }
}

#Preview {
    ContentView()
}

Preview provides crash :)

Same error. MacOS Sequoia Public Beta + Xcode 16 Beta 3. Every preview crashes after some time and doesn't recover until I close and reopen Xcode.

I am seeing this on Xcode 16.1 beta 1

Version 16.0 (16A242d)

any solutions?

This is still unresolved as of Xcode Version 16.1 (16B40) and the 16.2 beta.

However, I am not seeing this on all projects. I am noting this specifically on projects which use an XCFramework we are building. It works just fine on-device, but is crashing previews with this JITError.

In our case, it claims that all(?) of the symbols declared in our XCFramework component could not be found.

For our case, we were generally able to get the projects working again by using Legacy Previews Execution, but this is obviously not great.

For a "realistic" example project, see https://github.com/stadiamaps/ferrostar. For a much more minimal project, see https://github.com/ianthetechie/uniffi-starter.

We're tracking this in https://github.com/stadiamaps/ferrostar/issues/344

Still having JIT errors on device preview

This is happening with the latest release version of Xcode, v16.2 (16C5032a) and I do not have a test framework installed unlike another example funktional-ee mentioned above. This was a brand new project which has not worked with preview since creating it.

Xcode previews fail with JIT error
 
 
Q