I tried creating a new app, with a new container, using the Xcode 'stock' Item ie; item.timestamp. I tried it in a 17.4 simulator and iPhone with 17/4. Both failed for the same reason as noted by the OP. Fatal error: Could not create ModelContainer: SwiftDataError(_error: SwiftData.SwiftDataError._Error.loadIssueModelContainer). I also have a "Live" App that is not loading because of 17.4. Also... I have played with the relationships as described in the posts above and nothing worked. Again - Apple's stock, stripped down, Items app is failing.???
Update:
As for my app...
The culprit was that I had added modelContext into the environment using both an @Environment call and .modelContainer on WindowGroup. By the way, this worked prior to 17.4. The solution was to remove : @Environment(.modelContext) private var modelContext.
As for the 'stock app', I discovered that the issue was that timestamp is not marked optional so it fails. Marking it optional? and then providing ?? Date.now values where needed solved the problem.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: