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.

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.

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

Cannot preview in Xcode 15 Beta
 
 
Q