UserError: .p12 contains multiple certificates

Hello,

we’re getting the following message when trying to build an iOS app:

UserError: .p12 contains multiple certificates. Regenerate so it has only one certificate.

I think it’s due to the way the .p12 was generated, though that same .p12 works fine when building with phonegap.
It was created by selecting the certificate and private key in the Keychain Access (in the ‘keys’ category) on Mac. So it only has one certificate (plus a private key).

When exporting the certificate itself (category ‘my certificates’) as .p12 the app does built. But since that’s not how we did it with phonegap we’re not sure if everything will work the same when uploading to the app store.

Seeing as this is a difference between phonegap and Volt I’d figure that I’d ask here first.

We’ve seen this a few times. The best solution is to generate a fresh, clean set of certificates.

(Figuring out how to do this like PhoneGap is on our list, but new certs is a proven solution. The old ones would have expired at some point, so it’s not all bad news)

I have the same problem, and I have delete all my old Cert and redo everything. Its still give me the same error. I think there still the other cert in the icloud or the mac somewhere, I cant find it. Its not just expired cert. You guys need to allow multiple cert. For testing, its fine without the private key. But I don’t know if the app store will except it without the private key.

To build a completely clean key, you need to clear unused certificates from the Keychain Access app. Otherwise, it seems they get included.

I have reinstalled the mac os into my virtualbox and then deleted all the keys and all the certificates files. I even deleted all the certificates file in my apple account. My keychain access only have 1 certificate and a private key. And it still give me that error. I think you guys block the private keys to be able to build. This is not working for me. Btw, I use ad-hoc and the Pro Version.

I had a look at your p12 file. It has 4 certificates in it:

iPhone Distribution: Haven Tran (6PN3TNUU6U)
iPhone Distribution: Haven Tran (6PN3TNUU6U)
Haven Tran
Haven Tran

So you’re not there yet.

Everything is deleted, Nothing in there. I just have 1 cert, 1 private key and 1 public key. Those files are not from the mac. You guys need to allow multiple certificates files like phonegap build and apple. Anyway, But what odd is, I created the p12 without exporting the private key and it built just fine and I was able to submit my app to apple just fine too. It is under review. Does that mean my app don’t have a private key? or I no longer need to export 2 items (private key & Certicate) when I create my p12 and the private key already included? Anyway, I think the private key is what causing those error.

I just looked up on some other tutorial on how to make a p12 file. Some of them don’t require me to highlight both the certificate and the private key and then export 2 items.

but just: *** Right-click the distribution certificate and click Export “iPhone Distribution:” to create a P12 certificate file containing the distribution certificate and the private key.

Can it be when I click shift and highlight the 2 items (certificate & key) and export both items, I cause it to include the certificate and private key twice? And that is why I have multiple files.

Anyway, the solution for me is just Export 1 item “iPhone Distribution and don’t need to highlight the keys and export 2 items. I think the key already included in it.

Thanks for posting this!