Xcode 15 beta 1 failed to preview SwiftUI view in watchOS target

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:

  1. Create a new watchOS app project (with a companion iOS app) in Xcode 15.
  2. Both iOS and watchOS ContentView can be previewed at this step.
  3. 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)
  4. 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.

Answered by previewseng in 755991022

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:

  1. When the error banner appears, click the "Diagnostics" button in that banner.
  2. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  3. Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)
Accepted Answer

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:

  1. When the error banner appears, click the "Diagnostics" button in that banner.
  2. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  3. Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)

same problem, Xcode 14 has this problem too

Same problem i filed feedback: FB12412988

Has this been solved? I encounter that very same issue with Xcode 15 (final version)

@yellow8 No, the issue persists.

I'm truly disappointed with the Xcode Previews team. It's not about the bugs, but their response to them. Every time I report a bug in Previews, they respond with a standard template asking for a diagnostic file. As you can see in this post, even when I provide detailed steps that reproduce the issue 100% of the time, they simply ignore them and continue to request the diagnostic file. They might even tell you it's a known issue, but still, they ask for a diagnostic file.

So, I've given up.

Have the same issue, searched around but no solution was found.

You can temporary fix this problem via:

  1. Duplicate the WatchOS sheme and name it Preview-......
  2. In Edit Scheme > Build Remove the iOS companion app from the list.

Then switch to Preview- scheme when you want to preview the watchOS app Swift views.

The issue was fixed in SwiftUIIntrospect 1.1.1 version.

Xcode 15 beta 1 failed to preview SwiftUI view in watchOS target
 
 
Q