Xcode 15.0 Beta 5, Symbol not found: _$s9SwiftData014DefaultBackingB0C3forACyxGxm_tcfC

When running a macOS app on Xcode 15 Beta 5 (15A5209g), I get a Symbol Not Found error.

  • Problem: App will not run. Error received. Symbol Not Found: SwiftData Default Backing For AC
  • Environment: Version 15.0 beta 5 (15A5209g), macOS 14.0 Beta (23A5257q)
  • App: macOS

SwiftData Model

@Model class Audit {

init() { }

}

Error: dyld[875]: Symbol not found: _$s9SwiftData014DefaultBackingB0C3forACyxGxm_tcfC Referenced from: <75DF3350-4DD5-3AF4-80DA-B17B0EDD26C2> /Users/dking/Library/Developer/Xcode/DerivedData/{redacted}-bigzojxvffztaaaepdczriowvoie/Build/Products/Debug/{redacted}.app/Contents/MacOS/{redacted} Expected in: <CC32CD58-C2DD-3D49-B2BB-9199DDD32D12> /System/Library/Frameworks/SwiftData.framework/Versions/A/SwiftData

Post not yet marked as solved Up vote post of dkk277 Down vote post of dkk277
3k views

Replies

I personally would try cleaning the build folder and then rebuilding to see if that fixes the problem. If that does not work, could you provide more context about where the provided code is used?

Thanks for the reply, cleaning the derived data folder did not help. I'm providing the code from 2 files that you can just copy and paste to get the error. Let me know if I can provide any other info. Thanks for the help!

File 1:

@Model class Audit {

init() { }

}

@main struct MarketProbeApp: App {

let container = try! ModelContainer(for: Audit.self)

var body: some Scene {
    WindowGroup {
        ContentView()
    }
    .modelContainer(container)
}

}

File 2:

import SwiftUI import SwiftData

struct ContentView: View {

var body: some View {
    Text("Hello, World")
}

}

struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }

While on macOS beta (23A5257q) I was able to get my app to run on Xcode Version 15.0 beta (15A5160n) but I have now updated to macOS beta (23A5301h) and I get a similar error stating Symbol Not Found while on the same Xcode version (15A5160n). See here:

dyld[9265]: Symbol not found: _$s011_SwiftData_A2UI5QueryV6filter4sort11transactionACyxSayxGG10Foundation9PredicateVyxGSg_SayAI14SortDescriptorVyxGG0aC011TransactionVSgtcAGRs_rlufC Referenced from: <A2E5C6C5-391C-3BAE-9A0D-3451D8123CFC> /Users/{redacted}/Library/Developer/Xcode/DerivedData/MarketProbe-cqnacjmztpbzypbbvdreasnhtmbu/Build/Products/Debug/MarketProbe.app/Contents/MacOS/MarketProbe Expected in: <4A72DA74-BDCA-37CE-9A19-B4AD02FD483D> /System/Library/Frameworks/_SwiftData_SwiftUI.framework/Versions/A/_SwiftData_SwiftUI

Having the same issue with the exact same missing symbol for SwiftData on an app that had no changes, but started crashing on the ios was updated to 17.0 (21A5303d) and macOS to 14.0 Beta (23A5312d). Apple crashes on launch in both versions.

Post not yet marked as solved Up vote reply of Hafu Down vote reply of Hafu
  • Can you check if your SwiftData properties have default values, and if so, remove them and just set them from init? So if you have a property called var creationDate: Date = Date() change to var creationDate: Date, and in init() set the date to Date(). Let me know the result, I'm curious!

  • I didn't have any default values, but I also tried changing them all to optionals just in case, and that didn't help either. :(

Add a Comment

I have the same issue using a fresh MacOS app with sample SwiftData code.

Xcode Version 15.0 beta 6 (15A5219j)

MacOS 14.0 Beta (23A5301g)

import SwiftUI
import SwiftData

struct ContentView: View {
    @Environment(\.modelContext) private var modelContext
    @Query private var items: [Item]

    var body: some View {
        NavigationSplitView {
            List {
                ForEach(items) { item in
                    NavigationLink {
                        Text("Item at \(item.timestamp, format: Date.FormatStyle(date: .numeric, time: .standard))")
                    } label: {
                        Text(item.timestamp, format: Date.FormatStyle(date: .numeric, time: .standard))
                    }
                }
                .onDelete(perform: deleteItems)
            }
            .toolbar {
                ToolbarItem {
                    Button(action: addItem) {
                        Label("Add Item", systemImage: "plus")
                    }
                }
            }
        } detail: {
            Text("Select an item")
        }
    }

    private func addItem() {
        withAnimation {
            let newItem = Item(timestamp: Date())
            modelContext.insert(newItem)
        }
    }

    private func deleteItems(offsets: IndexSet) {
        withAnimation {
            for index in offsets {
                modelContext.delete(items[index])
            }
        }
    }
}

@Model
final class Item {
    var timestamp: Date
    
    init(timestamp: Date) {
        self.timestamp = timestamp
    }
}

I'm having the same issue, so I'm replying to subscribe to this thread :)

I am still having this issue with Xcode 15 beta 6 and macOS 14.0 beta 23A5312d

I'm also seeing this issue... uninstall Xcode beta and reinstall had no effect on the error. If I navigate in finder I can see there is no swiftdata.frameworks/ installed on the machine.

Same issue here with no change to my code from yesterday to today. Only difference is I upgraded to iOS 17 beta 6. Apps work fine on other devices and simulators.

I'm having the same issue.

Same here. I've tried even with a blank boiler plate project and it still has the same issue. I'm on Version 15.0 beta 6 (15A5219j)

eagerly awaiting Xcode beta 7 at this point... I'd really like to keep working on my app.

Same issue here. Xcode beta 6 is a bit buggy it seems

Experiencing the same issue. I'm on Xcode 15 beta 6.

The same issue happened to me on beta 5. Upgrading to beta 6 worked a few days ago.

However, I recently updated to the latest iOS 17 beta and now it's crashing again with the 'Symbol not found' error.

Hope this gets fixed soon.

  • This is exactly what I am experiencing as well.

Add a Comment

Having the same issue :~(