App Groups capability is not available for Mac Catalyst provisioning profile

I'm trying to build my iOS app to macOS Catalyst. Everything works fine when running locally on my machine via Xcode, but an error occurs when I archive and try to upload to the notarisation service:

Code Block
Cannot create a Mac Catalyst Developer ID provisioning profile for "br.com.marcosatanaka.music-harbor".
The App Groups capability is not available for Mac Catalyst Developer ID provisioning profiles. Disable this feature and try again.

I have the App Groups capability enabled on my app's target Signing & Capabilities tab on Xcode. But, when I go to the Apple Developer portal under Certificates, Identifiers & Profiles > Profiles and select the Mac Catalyst provisioning profile (automatically generated by Xcode), the App Groups capability is not present on the Enabled Capabilities section.

I can work around this issue by removing the com.apple.security.application-groups entitlement when building for Mac Catalyst, but that causes me a runtime error when Core Data tries to access the store located on the shared container. I also need it to be on a shared container because I want to access the database from both the main app and also the new widget extension.

How can I add the App Groups capability to my Mac Catalyst provisioning profile?
Answered by marcosatanaka in 624934022
I was able to fix this by turning the App Groups capability off and on on all of my app target's on the Signing & Capabilities tab on Xcode.
Accepted Answer
I was able to fix this by turning the App Groups capability off and on on all of my app target's on the Signing & Capabilities tab on Xcode.
I'm having the same issue but because of CarPlay support, I had to turn off "automatically manage signing" in Xcode. When I go to the developer portal, look at my identifier, and click on the information button for App Groups it says the Platform Support is "tvOS, iOS, watchOS". I'm using the same identifier for macOS and iOS.

Anyone know how to manually add the App Group capability to the macOS provisioning profile?
Figured out my problem. For anyone who is using manual signing, when you create your Provisioning Profile you need to select "Mac Catalyst" for the Profile Type instead of "Mac". I guess that's pretty obvious but be aware that when you view the profile in the portal, the App Groups capability still won't show up on the Enabled Capabilities section.
I have a very similar issue. I have a multiplatform app, written in SwiftUI for iOS and macOS and for the macOS signing options i checked the "use ios bundle identifier" everywhere. I created an app group for iOS and for macOS. I created both appgroups in the dev portal. I created all the provisioning profiles manually (for iOS dev and iOS app store and the same for macOS and then 2 other sets for the widget extensions for iOS and macOS), but for some reason all my macOS profile only have the "in-app purchase" capability enabled but I need the app groups capability as well. This is so frustrating and annoying. I've never used xcode's auto managing profiles options, I've always created all of them manually so I do not consider myself new to this "territory" but I cannot find anything about this issue.

I'll jump in to add that i solved this and in my case the Version Control Program or Visual Studio added a new line char before the group identifier causing a mismatch with the group name that was athorized by the profile. In short the error was in the info.plist, not in the profile.

App Groups capability is not available for Mac Catalyst provisioning profile
 
 
Q