Current project structure:
- Main iOS app (targets iOS 17).
- Widget Extension (targets iOS 17).
- Watch app (targets watchOS 10).
- Complications Extension (a Widget Extension, targets watchOS 10).
I did have the complications embedded within the Watch app, but you cannot have two @main
s in the same target so the complications are in their own WidgetKit extension.
Sadly, when you add a WidgetKit extension to your project, Xcode ALWAYS sets it as an iOS widget extension; it doesn't give you the choice to make it a watchOS extension so you have to figure it out yourself.
Now, I'm hitting an issue where the main iOS app works fine, the iOS widgets work fine, the Watch app runs fine, but the complications dot show up anywhere. I can't preview them in Xcode because it says various things like:
This app was not built to support this device family; app is compatible with (
1,2
) but this device supports (
4
}
I can't find any information on what goes where in the build settings.
Can someone tell me how each bit of the project should look in the build settings, please?
(There's no information anywhere in Apple's developer documentation - which is a bit weird. They've released Xcode and they have no information on the various bits. And why doesn't Xcode set up a WidgetKit extension properly when you add it? Must we all do this manually, Apple?)
It's really difficult to tell from this description what exactly is going on in this project, and thus what's gone wrong. I'm not seeing Xcode ALWAYS set a Widget Extension to be an iOS Widget Extension. Where/how are you adding it to your project? I'm doing the following and seeing the widgets provided in the template show up in Previews:
If you are doing the same—adding a watchOS WidgetExtension to your project—and still having trouble, consider contacting Developer Technical Support for some 1:1 help (you can do this from your Developer account).