Hello!
I can't preview the SwiftUI views of watchOS target in Xcode 15 beta 1, when the containing iOS app has a SPM dependency. Reproducing steps:
- Create a new watchOS app project (with a companion iOS app) in Xcode 15.
- Both iOS and watchOS
ContentView
can be previewed at this step. - Add a Swift package to the iOS target (the package should be an iOS-specific package, not a watchOS one, for example, https://github.com/siteline/SwiftUI-Introspect)
- After you add the static library to iOS target, the watchOS preview no longer work anymore.
If you check the error message, you can find the Xcode preview attempt to build the iOS package against watchOS SDK.
I'm pretty sure this is a known issue, but the best thing for us would be to file a Feedback request with a previews diagnostics file.
The most helpful thing is to download and install the logging profile for your Mac/device. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift Attach the sysdiagnose to the radar as well as the diagnostics using the instructions below.
Then when you reproduce the problem in Xcode:
- When the error banner appears, click the "Diagnostics" button in that banner.
- In the sheet that appears, click "Generate Report" in the bottom left of the sheet
- Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)