Cannot preview in Xcode 15 Beta

I am not able to present the preview of xcode 15,

I am having the error message "Cannot preview in this file" "Syntax error" but I have no error in xcode.

Replies

Hi,

Sorry to hear you are having problems getting previews working. It is a known issue that currently using the #Preview macro does not allow building in projects with a deployment target < 17.0 or running on a device running a version of iOS < 17.0, and the presence of an @available attribute on the macro causes the kind of syntax error you are seeing. For now you will have to use #Preview only in projects that have a deployment target of the current beta releases, or revert to using a PreviewProvider.

  • Is this something that can be fixed in a future Xcode beta release, or will we have to install the latest MacOS beta? PreviewProvider produces a separate error 'Fatal Error in SchemaProperty.swift'.

  • Sorry, I can't comment on future releases. As for the PreviewProvider issue sounds like a separate and not tracked issue. Would you mind filing a feedback and include a preview diagnostics Editor > Canvas > Diagnostics?

Add a Comment

This solution works, at least for me, I hope it helps.

https://medium.com/@ziminny/macos-sonoma-xcode-15-ios-17-bug-in-ios-version-emulator-and-preview-a320e47a81ca

having the same issue, hope apple will release a fix soon