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.
Post
Replies
Boosts
Views
Activity
For me I think the fix was changing my Dockerfile to disable automatic resolution. NOTE: that I also deleted my derived data directory.
RUN swift build \
		--enable-test-discovery \
		--disable-automatic-resolution \
		-c release \
		-Xswiftc -g
Not sure if this had a material impact but while I was in there... I upgraded my docker build:
#FROM swift:5.2.3-bionic as build
FROM swift:5.3-bionic as build
I also started learning recently. I started with Apple's two swift programming books as referenced by mhanlon99, going thru the intro book first, followed by App Dev with Swift. It helped also having the teacher's book & source to get me out of a pinch. Then I started selecting topics of interest, and watched Kilo Loco YouTube videos, past WWDC sessions & Ray Wenderlich tutorials. I also can't say enough about Paul Hudson's materials and Ray Wenderlich's overall commitment to the community with things like Office Hours. Paul and Ray also introduced me to dabbling with full stack and Vapor Swift. I'm now using Tibor Bodecs' incredible Practical Server... Vapor 4 book. I'm learning as much about Swift, architecture and debugging as I am Vapor. My next target: SwiftUI & CloudKit then building & deploying some things. Good luck!