Hello,
Since I added Core Data to my SwiftUI project, preview canva is no more working, showing an error explaining that the update took more than 5 seconds (the app is working correctly in simulator).
I opened the preview diagnostic report folder, and found a file named SerializationErrors.txt, with the following message:
Error Domain=NSCocoaErrorDomain Code=516 "“SizeModel+CoreDataClass.swift” couldn’t be linked to “Intermediates” because an item with the same name already exists."
I feel like there is a problem of refreshing the class generated for my Core data model. I tried to follow some recommendations found on this website, deleting the Library/Developer/Xcode/UserData/Previews/Simulator Devices/, or also Library/Developer/Xcode/DerivedData, and cleaning/closing Xcode, but none of them had any effect on the problem.
Doing so, I noticed that in the Previews folder, two Simulator Devices were generated (one empty "Simulator Devices", and one filled "Simulator%20Devices"), and regenerated even if I clear them. I don't know if it could be related, but I don't know anymore where to search...