问题
When I'm trying to upload my app to the Mac App Store, I get the error -
iTunes Store operation failed.
Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on Mac OS X. Specifically, value '[group.MyCompany.MyProject]' for key 'com.apple.security.application-groups' in 'com.MyCompany.mac.MyProject.pkg/Payload/MyProject.app/Contents/MacOS/MyProject' is not supported. This value should be a string or an array of strings, each starting with your TEAMID followed by a dot '.' .
But I read that the shared group MUST begin with the group.
prefix - so what is the correct way ?
回答1:
No, macOS App Groups MUST begin with your development team ID.
The value for this key must be of type array, and must contain one or more string values, each of which must consist of your development team ID, followed by a period, followed by an arbitrary name chosen by your development team
Please check below sample from Apple develop page.
https://developer.apple.com/library/mac/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW19
<key>com.apple.security.application-groups</key>
<array>
<string>DG29478A379Q6483R9214.HolstFirstAppSuite</string>
<string>DG29478A379Q6483R9214.HolstSecondAppSuite</string>
</array>
回答2:
group.identifier
is used for iOS App Group names; TEAMID
followed by a dot and then name (as the error message states) is used for Mac App Group names.
Also keep in mind that this must be your development team ID; do not use $(TeamIdentifierPrefix)
, as Xcode suggests.
For some reason the $(TeamIdentifierPrefix
) build-time variable isn't resolved properly while archiving a project.
Using Jerry's application group name should work.
来源:https://stackoverflow.com/questions/38037745/should-macos-app-group-name-start-with-group-or-development-team-id