Just to add my name to the list, I'm facing the exact same issues when debugging on iOS 17/Xcode15.
The app freezes at launch for a long time, waiting for the debugger. Usage is affected as well, with all the most verbose actions taking a long time to display on terminal and being rendered on screen.
Post
Replies
Boosts
Views
Activity
I've got some news, which are discomforting:
I can drive from local to cloudkit if I relaunch the app with changes, simulating multiple updates.
In short, if I follow these passages, everything seems to work:
Remove any cloudkit entitlement
Migrate the local swiftData to a CloudKit-compatible schema
Re-add the CloudKit entitlement
Migrate the ModelConfiguration to use the preferred cloudKitDatabase
This is definitely not something I can do, as I there must be a way to execute all these steps in one go?
It also seems that a cloudKitDatabase: .none is not respected.
let fromSchema = Schema(versionedSchema: ModelSchema_050624.self)
let starterConfiguration = ModelConfiguration(
nil,
schema: fromSchema,
isStoredInMemoryOnly: false,
allowsSave: true,
groupContainer: groupContainer,
cloudKitDatabase: .none
)
let modelContainer = try ModelContainer(
for: Country.self,
Episode.self,
Movie.self,
Season.self,
Show.self,
Network.self,
NetworkSubscription.self,
migrationPlan: AppModelMigrationPlan.self,
configurations: starterConfiguration
)
return modelContainer
If the CloudKit entitlement is active (checked), this code throws:
Thread 1: Fatal error: Could not initialize model container SwiftDataError(_error: SwiftData.SwiftDataError._Error.configurationSchemaNotFoundInContainerSchema)
If the CloudKit entitlement is not active, this code migrates successfully.