I have an app that uses Core Data and CloudKit that I am trying to convert into a SwiftData CloudKit app. Things were working very well until this most recent beta (beta 5) of Xcode 15.0. I have image data which the app saves as Data in external storage. I let Xcode convert my Core Data model in to a SwiftData model. As I said, things were working well. I could turn the image data into an Image for SwiftUI. That is, until beta 5. With beta 5, I get the following.
SwiftData/BackingData.swift:210: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON."
Well the data is NOT JSON, it is image data and yet, I get this fatal error. Does anybody else see this?
I have saved data using the app on the beta 5 simulator using SwiftData and I have verified that the data is correct using my core data app. The images are fine.