WatchOS Preview fails to compile when Swift Packages are added for iOS

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)

Related Firebase sdk thread: SwiftUI previews breaks when adding a watchOS target · Issue #7610 · firebase/firebase-ios-sdk · GitHub

Is there a workaround for this issue?

Terms of Service

Privacy Policy

Cookie Policy