SwiftData modelContainer Error

It's been frustrating to solve this error. My iOS device and Xcode are fully updated. I can easily run app on simulator, but issue happens on my iPhone. dyld[23479]: Symbol not found: _$s9SwiftData12ModelContextC6insert6objectyx_tAA010PersistentC0RzlFTj Referenced from: <6FC773BB-E68B-35A9-B334-3FFC8B951A4E> Expected in: /System/Library/Frameworks/SwiftData.framework/SwiftData

I had a similar problem (different symbol, but similar) after upgrading to Xcode 15 b6, and a project clean fixed it.

I had something similar and I made my attributes optional; and the error was cleared .

@Model final class Item { var timestamp: Date? var title: String? var actualjournal: String? var time: String?

init(timestamp: Date, title: String, actualjournal: String, time: String) {
    self.timestamp = timestamp
    self.title = title
    self.actualjournal = actualjournal
    self.time = time
}

}

SwiftData modelContainer Error
 
 
Q