SwiftUI error: "cannot preview in this file"...

Have been working on a SwiftUI widget for WidgetKit, and, after updating to beta 3, at some point, started getting this error:

Cannot preview in this file—"widget.appex" is an unsupported extension

The details say: UnknownAppExtensionError: "(widget).appex" is an unsupported extension. Previews cannot be hosted in the app extension "widget.appex"

Has anyone seen this before? The widget had been previewing fine, and it builds and runs to simulator just fine.

Replies

Disregard. Leaving this post up for posterity, but a simple quit and relaunch of Xcode resolved the issue.
  • This doesn't seem to be working in macOS Monterey 12.0.1 (21A559), Xcode 13 13.1 (13A1030d) even after quitting and relaunching Xcode

Add a Comment

Not working for me in Xcode 14.1 RC