今回はMacのApplication Loaderを使用してiOSアプリをAppStoreにUPする際に表示されたエラーの対応方法をご紹介いたします。
私の場合は、Apple developer programにプッシュ通知の証明書を追加し、デバッグでも正しくプッシュ通知が行えていたので、正式にリリースしようと思った矢先の事でした。
ERROR ITMS-90163: Invalid Code Signing Entitlements.
The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'aps-environment' in 'Payload/AppName.iOS.app/AppName.iOS'.
前提条件
・Windows10 Pro 64Bit
・Visual Studio 2015 Community Update3
・Xamarin 4.3.0.795 (NuGet Xamarin.Forms 2.3.4.247)
・macOS Sierra 10.12.4 / Xcode8.3.1 / Xamarin.iOS 10.6.0.10
・AppleDeveloperProgramへの申し込み(年間12,000円程)
1.Entitlements.plistファイル
まずは、Entitlements.plistファイルの中身を確認します。
iOS Bundle Signingのカスタムの権利にDEBUGとRELEASEで異なるファイルを設定している場合はそれぞれ確認します。
プッシュ通知の場合のみだと中身は以下のようになっているはずです。
Entitlements.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>production</string>
</dict>
</plist>
2.プロビジョニングプロファイル
プロビジョニングプロファイルの中身をテキストエディタで開いて確認します。
エラーの内容からは以下の項目にない設定がEntitlements.plistファイルに設定されているから駄目だとのことが読み取れますので、以下の項目を正として、もう一度Entitlements.plistファイルの中身を確認してみてください。
distribution.mobileprovision
<key>Entitlements</key>
<dict>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>app-proxy-provider</string>
<string>content-filter-provider</string>
<string>packet-tunnel-provider</string>
<string>dns-proxy</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>APPID99999.*</string>
</array>
<key>get-task-allow</key>
<false/>
<key>application-identifier</key>
<string>APPID99999.com.CompanyName.AppName</string>
<key>com.apple.developer.team-identifier</key>
<string>APPID99999</string>
<key>com.apple.external-accessory.wireless-configuration</key>
<true/>
<key>aps-environment</key>
<string>production</string>
<key>com.apple.developer.networking.vpn.api</key>
<array>
<string>allow-vpn</string>
</array>
<key>beta-reports-active</key>
<true/>
</dict>
私の場合は、Entitlements.plistファイルの中身はaps-environmentの項目しかなく、プロビジョニングプロファイルと相違はなかったのです。
そこで、プロビジョニングプロファイル自体を再作成してみました。(プッシュ通知の証明書を作成した後に、distributionのプロビジョニングプロファイルも更新したはずだったのですが、、、)
すると、何のエラーもなくAppStoreにアップできました。
ちなみに余談ですが、Distributionのプロビジョニングプロファイルや証明書を削除しても本番のアプリは大丈夫でした。まあ当然ですよね。
ただ、プッシュ通知やVoIPなどの証明書は運用中に削除してしまうと送信できなくなったりしそうなので、くれぐれもお気をつけてプロファイルを再作成しましょう。
最後までお読みいただきありがとうございます。
当ブログの内容をまとめた Xamarin逆引きメニュー は以下のURLからご覧になれます。
https://itblog.dynaspo.com/blog-entry-81.html
- 関連記事
-