Post

Replies

Boosts

Views

Activity

Reply to Preview throwing error HumanReadableSwiftError ConfigurationError: noPreviewInfos
Once, I found that the project had multiple targets. And the file wasn't a member of the currently selected target. But that only happened once. Other times, I found that repeatedly clicking the preview button (or repeatedly pressing Option-Cmd-P) fixed it. But most of the time, the preview is simply not appearing. Xcode 12.0 and 12.2 series are rough for me, right now.
Oct ’20
Reply to Preview throwing error HumanReadableSwiftError ConfigurationError: noPreviewInfos
After upgrading to Xcode 12.2 beta 3 (12B5035g), one failing preview offered an error: a unittest (i.e. an XCTestCase subclass) was not part of any target. Of course, it was part of the unittest target only. So I have no idea why the preview depended on that unittest file. I just deleted the file from Xcode, and for this project, the error "Failed to build ***.swift" keeps popping up above the preview but if I repeatedly hit Cmd-Shift-P, it does render. Edit: never mind, other views no longer render. Very frustrating.
Oct ’20
Reply to Preview throwing error HumanReadableSwiftError ConfigurationError: noPreviewInfos
The problem cropped up again, and I bit the bullet. In Xcode, I created a new project and copied all the source from the old to the new project. I recreated everything in the new project, meaning: set the bundle ID, version number, build number, launch screen et cetera. That fixed it. So, it's not the source files themselves, it's something in the project file(s). I did a manual diff between the <projectname>.xcodeproj/project.pbxproj of the old and the new project, but I gave up after staring 15 minutes at the incredibly messy diff. Preview now work.
Jan ’21