When attempting to load a SwiftUI canvas for my watchOS app, it fails to load because Xcode attempts to compile the Swift Packages that are meant for iOS against the watchOS sdk.
Error examples:
"While building for watchOS Simulator, no library for this platform was found in 'ABC.xcframework'" for a framework
"Cannot find type 'UITableViewController' in scope" for packages that are all swift source code (UITableViewController is not available in watchOS)
I've run into this same (or similar) issue:
I have an iOS app with watchOS app and a single Swift Package (SwiftMQTT). All Previews fail with a message stating that a file in the SP (getStreamsToHost) is unavailable in watchOS. The SP is not referenced from any watch app file though.
The Firebase thread referenced above stated that the problem was fixed in Xcode 13, but I am running on Xcode 14.2. Has the problem been regressed?
You can try removing your ios target from the watch scheme in Xcode. This seems to allow previews to build but I am not sure what other consequences that may have yet. I recently posted this question and filed an apple issue here