Shortcut Extension in Catalyst App Build

I have an Intent handler that is used on iOS in shortcuts for my app. The app is also a Catalyst app, but when I try to build it with the Extension I get the following message.

Code Block
error: Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier.

I am assuming that I cannot include the extension in Catalyst, is that true in iOS14?
Answered by Frameworks Engineer in 616465022
You can include the extension in Catalyst, but in macOS Big Sur it will only be used if for WidgetKit widget configuration.

The error you are seeing is that the bundle identifier of any extensions inside of your app need to be prefixed with the bundle identifier of your app. For example, if your app's bundle identifier is com.apple.soupchef, then your extension bundle identifier might be com.apple.soupchef.intents.

What is likely happening here is that you have a different bundle identifier for your app in Catalyst, i.e. com.apple.soupchef.mac, and if that is the case your Intents extension will need have to have a different bundle identifier as well, i.e. com.apple.soupchef.mac.intents
Accepted Answer
You can include the extension in Catalyst, but in macOS Big Sur it will only be used if for WidgetKit widget configuration.

The error you are seeing is that the bundle identifier of any extensions inside of your app need to be prefixed with the bundle identifier of your app. For example, if your app's bundle identifier is com.apple.soupchef, then your extension bundle identifier might be com.apple.soupchef.intents.

What is likely happening here is that you have a different bundle identifier for your app in Catalyst, i.e. com.apple.soupchef.mac, and if that is the case your Intents extension will need have to have a different bundle identifier as well, i.e. com.apple.soupchef.mac.intents
So for Big Sur I should no longer have the catalyst identifier defined as: maccatalyst.com.me.name ? but it should match the iOS identifier as com.me.name
Try adding a DERIVE UIKITFORMAC PRODUCT BUNDLE IDENTIFIER (replace the spaces with underscores) user defined flag to the extension build settings and set it to YES. I had a similar issue with my app's widget on catalyst and that's how I solved it.
Shortcut Extension in Catalyst App Build
 
 
Q