とあるアプリで、AppStoreに提出時のこのエラーがなかなか修正できなかった。
Validation failed
Invalid code signing entitlements. Your application bundle’s signature contains code signing entitlements that aren’t supported on macOS. Specifically, the “[group.xxx.xxxxxxx.xxx]” value for the com.apple.security.application-groups key in “xxx.xxxxxxx.xxx.pkg/Payload/XXX.app/Contents/MacOS/XXX” isn’t supported. This value should be a string or an array of strings, where each string is the “group” value or your Team ID, followed by a dot (“.”), followed by the group name. If you're using the “group” prefix, verify that the provisioning profile used to sign the app contains the com.apple.security.application-groups entitlement and its associated value(s). (ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
和訳すると
検証に失敗しました。
無効なコード署名エンタイトルメントです。アプリケーションバンドルの署名に、macOS ではサポートされていないコード署名エンタイトルメントが含まれています。具体的には、xxx.xxxxxxx.pkg/Payload/XXX.app/Contents/MacOS/XXX 内の com.apple.security.application-groups キーに指定された [group.xxx.xxxxxxx.xxx] の値がサポートされていません。
.entitlementsファイルは正しいのに、なぜかアプリのパッケージ内のファイルにApp Groupの部分が書き込まれない。
XcodeのSigning and CapabilitiesでApp Groupを削除したり追加したりBuild Cleanしたりリビルドしたり何をやってもダメで、最終的に解決した方法は…
使ってないけどGame CenterをSigning and Capabilitiesに追加してビルド(Archive)する、だった。
たぶん、Game Centerじゃなくても何か使ってないCapabilitiesを追加すれば良かったんだと思うけど、これがトリガーになって無事書き込まれたっぽい。その後、Game Centerを削除しても問題なかった。