I've just tried removing the Complications extension target and the ComplicationsIntentHandler target, and putting the complications views inside the Widget target. I have a ton of #if os(watchOS) everywhere, and I now don't get complications on the Watch.
Going back to the version before I removed the Complications targets, look at this page: https://developer.apple.com/documentation/widgetkit/creating-lock-screen-widgets-and-watch-complications?language=objc
It says:
"Add Lock Screen Widgets to Your Existing iOS App
If your iOS app supports widgets that appear on the Home Screen or in Today View, support Lock Screen widgets by adding the appropriate accessory widget family to the list of supported widgets you declare."
I added my Lock Screen widgets to the Widget target, and they worked fine. The Widget target successfully showed Home Screen widgets and used the WidgetIntentHandler.
That page also says:
"Add WidgetKit Complications to Your Existing watchOS App
In case your existing watchOS app doesn’t offer complications, add a watchOS widget extension to your project in Xcode, and create complications with WidgetKit."
This suggests to me that both Widgets and Complications should be in their own extension targets, not in the same one.
Well, mine did use complications before, but I decided to drop support for the older ClockKit stuff and just go with the new watchOS 9 stuff. That page suggests you add a new target - that's what I did, I added the Complications target. But if I try to use the same intent handler with both the Widget extension and the Complications extension Xcode says I can't use the same intent in more than one extension. So I created a duplicate of the widget intent handler for the Complications, and Xcode doesn't like that either.
Basically, I can't use:
A Widget extension with its own intent handler, and a Complications extension with its own intent handler.
A Widget extension and a Complications extension that share the same intent handler.
A Widget extension with its own intent handler and no complications (because complications apparently have to be in their own widget extension).
It's a trash bin. Xcode should be better than this. Your documentation should be better than this. Xcode is giving me conflicting errors, and there's no clear way of supporting widgets and complications with the same or indeed different intents. Xcode lets me deploy to the Simulator and physical devices with one configuration, then says it's not valid to go to the App Store. I change it according to what the error messages suggest, and then I can't deploy to the Simulator or devices anymore. How am I supposed to work with this?!