Error - Unable to import Certificate
Yes, I too, ran into this dreaded message while attempting to build our PhoneGap app for iOS. This problem occurs when PhoneGap’s build process attempts to sign your app with the certificate (the p12 file), you uploaded, using the credentials you provided. The P12 file contains your certificate and the matching private key. I must reiterate, these two information must match, in order for the PhoneGap build process to be able to sign your app.
There are couple things you can do to ensure your P12 is valid. The following instruction assumes you are enrolled with Apple Developer’s program. Remember, the sequence is important. So here we go.
- Generate a certificate request file. Just follow the “Generate a certificate signing request on Mac OS” section at: http://help.adobe.com/en_US/as3/iphone/... or
- Here you will see your request file “xxxxxxxxx.certSigningRequest” in your machine (located at the destination you selected at step #1).
- Generate your certificate with your request file from step #2 by following the instruction.
- Login to your apple developer account.
- Go to the “Certificate Identifiers & Profiles->Certificates”.
- On the right hand corner select “+” to add your certificate.
- Follow the instruction and upload your “xxxxxxxxx.certSigningRequest” from step #2 when prompted to.
- Download your new certificate once your certificate generated from step #4 above.
- At this point, go back to your “Keychain Access” application. Select “Keys” under “Category”. You should see your key with the name you gave in step #1. Expand that key and you should see the certificate listed under it. If not, do the following.
- Import the certificate you downloaded in step #3, into the “Keychain Access” application.
- Validate with step #4 again.
- Right click on your key and “Export” your key to a P12 file. IMPORTANT. The password you give here, will be needed to unlock your certificate at PhoneGap build configuration.
Please note, I’m assuming you already know how to generate the provision file. If not, log back into your Apple Developer’s account and create it there.
How to validate your P12 prior to uploading to PhoneGap build site?
- Open up “Keychain Access” application.
- Go to “File->Import Items”.
- Select your P12 file.
- Here the “Keychain Access” application will ask for the password you used during your P12 export.
- If the import works, then you are good to go.
- Otherwise, you must go back and read this article and validate again.