Search code examples
iosxcodecordovaionic-frameworkxcode9

Cordova iOS project: xCode 9 missing some entitlements


The xCode project I'm working on is a hybrid app generated by Cordova/Ionic with:

cordova build ios

In my xCode 9, when I go to "Targets" → "General" Tab → "Signing (Release)" section I can see that my Provisioning Profile has 12 entitlements, as you can see in the following image:

12 entitlements from general tab

Note that "aps-environment" is included.

Now, after archive process ("Product" → "Archive", click in the "Export..." button and choose "App Store" option) and selecting the same provisioning profile I can see the same 12 entitlements (What is great), as you can see in the next pic.

12 entitlements after archieve process

But now, after I click in the "Next" button I can see only 7 entitlements in the summary. Note that "aps-environment" is not present:

7 entitlements from summary

As a consequence my I'm receiving an e-mail message from App Store team saying that my .IPA is "Missing Push Notification Entitlement". The capability "Push Notifications" is enabled in the "Capabilities" tab.

I have tried reinstalling my provisioning profile, but not worked.

How can I fix it? Am I forgetting something?

Thanks for the help.


Solution

  • Solved.

    For some reason cordova build ios is generating the native project with the value of the key "Code Signing Entitlements" pointing to the wrong file location.

    So in the tab "Build settings", "Signing" section I changed the value <ProjectName>/Resources/value <ProjectName>.entitlements to value <ProjectName>/value <ProjectName>.entitlements for the key "Code Signing Entitlements" and all worked.

    Fix file location