When trying to run my document-based iPad app using iPadOS 18 beta and Xcode 16 beta, I get an error like the following after opening a document:
Thread 1: Fatal error: Failed to identify a store that can hold instances of SwiftData._KKMDBackingData<MyProject.MyModel> from [:]
In order to help track down what is going wrong, I downloaded the sample app from WWDC23 session "Build an app with SwiftData" found here: https://developer.apple.com/documentation/swiftui/building-a-document-based-app-using-swiftdata
When I try to run the end-state of that sample code, I get a similar error when running the app on my iPad and creating a new deck:
Thread 1: Fatal error: Failed to identify a store that can hold instances of SwiftData._KKMDBackingData<SwiftDataFlashCardSample.Card> from [:]
Given that the sample project is generating the same error as my own project, is this a problem with SwiftData and document-based apps in general? Or is there a change of approach that I should try?
Thread 1: Fatal error: Failed to identify a store that can hold instances of SwiftData._KKMDBackingData<SwiftDataFlashCardSample.Card> from [:] ... It did not happen with the first document I created, but re-opening that document reveals that nothing saved. The second document did save changes, but it resulted in this error on close.
I'd like to confirm that the relevant engineering team can now reproduce the issue described above, thanks to @litkyle, and is actively working on it. The issue is tracked with FB13950404 (or r.130044320 internally).
For the "no location available to save 'Untitled.sampledeck'" error, I saw it when running the app in a simulator, but not on a device, as I mentioned above. This issue may be relevant to FB13950404, but I am not completely sure if it is exactly the same, and so would suggest that you file a new feedback report so it doesn't get missed – If you do so, please share your report ID here.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.