Certificate is not included in provision's certificates
This error message is usually generated when there are no matching public keys in the .mobileprovision profile with the cryptographic identity that you use.
You can validate that the .mobileprovison is bind to this particular certificate by extracting the .p12 public key and search for a match under the <key>DeveloperCertificates</key>
array in the .mobileprovison's xml portion.
You could extract the public key from the .p12 cryptographic identity by using openssl
.
openssl pkcs12 -in <path_to_.p12> -clcerts -nokeys -out <path_to_resulting_public_key.pem> && cat <path_to_resulting_public_key.pem>
Once you know the public key, verify that it is listed under the <key>DeveloperCertificates</key>
in your .mobileprovison file. You can do this by either running the command below or simply open .mobileprovision with text editor such as notepad++
security cms -D -i <path_to_.mobileprovision> | grep -f <path_to_resulting_public_key.pem>
I'd also recommend to delete all .mobileprovision files and certificates from your appbuilder profile and then re-import the items in question.
You can do this by running the following commands:
appbuilder certificate // List certificates
appbuilder certificate remove <name or index> // Delete cerificates
appbuilder provision // List provisions
appbuilder provision remove <provision_id> // Delete provisions
appbuilder provision remove <provision_id> // Delete provisions
appbuilder provision import path/to/provision
appbuilder certificate import path/to/p12/cert
EDIT:
NOTE: You might also find interesting the following {N} plugin - https://github.com/NativeScript/push-plugin
Steps on how to generate a APNS certificate and a mobileprovision file.
- Verify that you have created and added a pair of matching certificate and provisioning profile in AppBuilder. For more information about certificates and provisioning profiles, see Configuring Code Signing for iOS Apps.
- Verify that the App ID in the provisioning profile is enabled for push notifications. In the Identifiers section in the iOS Developer Center, select your identifier from the list and review the enabled services. If needed, click Edit and enable the missing functionality. If you modify an existing App ID, make sure to recreate the matching provisioning profile and import it into AppBuilder.
- Verify that you have set the proper App ID for your application in the Project Properties dialog.
- Verify that you have created an Apple Push Notification service SSL certificate in the Certificates section in the iOS Developer Center and added it in AppBuilder.
- Verify that the type of the Apple Push Notification service SSL certificate matches the type of your certificate and provisioning profile for code signing your app. For example, both should be for development or for production.
- Verify that you have exported the P12 file for the Apple Push Notification service SSL cryptographic identity. For more information about how to export cryptographic identities from AppBuilder, see Export a Cryptographic Identity.