For anyone else having the same error, I fixed this by explicitly setting cloudKitDatabase: .none in my CloudKit-enabled app:
let schema = Schema([Entry.self, Group.self, Category.self, Allowance.self, RecordMetadata.self])
let configuration = ModelConfiguration(
"Default",
schema: schema,
isStoredInMemoryOnly: inMemory,
groupContainer: .automatic,
cloudKitDatabase: .none
)
let container = try ModelContainer(
for: schema,
configurations: configuration
)
It seems that the simple ModelConfiguration(isStoredInMemoryOnly:) constructor was using the .automatic CloudKit DB and for some reason, creating an in-memory container with .automatic CloudKit DB fails...
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: