iPhone app signing: A valid signing identity matching this profile could not be found in your keychain

Viewed 396095

I'm pulling my hair out over this. I just downloaded the iPhone 3.0 SDK, but now I can't get my provisioning profiles to work. Here is what I have tried:

  • Delete all provisioning profiles
  • Delete login keychain
  • Create new "login" keychain, make it default
  • Create a new certificate signing request
  • Create new developer and distribution certificates in the Apple developer center
  • Download and install them
  • Download the WWDR certificate and install it
  • Create a new provisioning profile and double click it to install

All the certificates report as valid, but Xcode still won't recognize them. What should I try next?

Edit:

I completely re-installed Mac OS X and from a fresh install installed the 3.0 SDK and still have the same problem.

33 Answers

I had the same problem: I first downloaded my certificates to my small MacBook while on the run. When trying to install the certificates on my iMac... then I ran into the problems described on this page.

After spending hours pulling my hair out like many of you, I performed the following steps to fix it:

  1. Close all your stuff except your webpage that should be logged into App Dev center.

  2. Open Xcode. Click WINDOW > ORGANIZER. Then click the Devices tab and select "Provisioning Profiles" on the left. That should bring up your provisioning profiles. Highlight one by one (if more than 1), right click and delete profile. Yes, just do it! Delete them all! (I kept making a new one after a new one trying to make the thing work.)

  3. From the first page you see after logging into the App Dev Center on the right side click "iOS PROVISIONING PORTAL" > (do not "launch assistant"). Instead click on the left side. Select CERTIFICATES. You will probably have just one line listed with your name/company - from there click on the right side REVOKE. Click OK to verify that's what you want to do.

  4. On the same page click DEVICES. Click the box next to your device you are trying to provision and click REMOVE SELECTED. Again click OK to verify.

  5. Wait about 2 minutes to let Apple do their thing.

  6. Now click on "HOME" that is on the left side navigation.

  7. Click "Launch Assistant"

  8. create a new app ID - call it whatever you want. Just make sure it's unique enough to know that's the one you just created because the others you've been messing with all day will not be deleted from Apples Dev Center.

  9. You should be able to follow the rest of the Assistant without troubles -- the main thing is you just had to delete your old provision profiles and start over.

Good Luck!

I encountered the same issue. This is because the private key of the certificate does not existing on your machine.

  1. If you are now using a new machine and download the certificate from website: You can export the certificate from the old machine and then import on the new machine.

  2. If you share the developer account with someone: You ask the account owner to send you an invitation and become a team member of that account. Then you can create your own certificate from scratch.

  3. If you don't want to handle all these sh*t: Just revoke the certificate on website and delete the copy on your local machine. Then request a new one. This should be the ultimate way for solving such issue.

Had the same problem yesterday. Now, after signing to the developer portal, for every invalid provisioning profile have a button "Renew". After renewing and downloading updated provisioning profile all seems to work as expected, so problem is definitely solved :)

Update: you may have to contact Apple to get a "Renew"-button, or they removed it -- and the solution is to just download it and add it to the keychain, no need to renew.

What I found was that I needed to drag the distribution_identity.cer file that I downloaded from the "Certificates -> Distribution" page on the developer program portal into the keychain access program, then this error went away.

For me it only worked when the certificate and both keys were in the Login keychain. I had created a Development keychain before, but the Xcode Organizer wouldn't find the keys in there. So I moved them back to Login, quit the keychain tool - and voila, the error in Xcode Organizer went away! This was on Snow Leopard 10.6.2 with the 3.1.3 SDK.

The best answer I got was exporting your key, instead of just trying to import the cert file.

When you export the key from the keychain that generated the request, you get a Certificates.p12 file, which rolls the keys you need together.

Then import this into the new computer.

With keys like this, it's probably good to keep a rolled, certificate package file, because many times the "public" key, or cert file, is not enough to restore things from.

Did you try rebooting your Mac and your device? Lame answer, but I always try that first.

I got it working after re-doing everything and then creating an empty project with XCode and building/running it to the device. XCode showed a window asking something like: Do you want to accept the developer certificate. I pressed "Always". Only after this step I got rid of the message "A valid signing identity matching this profile could not be found in your keychain" in Organizer.

Hey guys, I had heaps of trouble with this yesterday. I went through the whole process a few times, requesting a new certificate request from the authority with the assistant, clearing out everything in the portal, uploading the certificate, creating a new profile and downloading everything. No dice.

However, check this out.

First up clear out all the certificates on the portal to start fresh.

After creating the new certificate request with the assistant, press "Show in Finder", and double click that bad boy. You should get a popup for the Certificate Assistant with a screen showing "Please specify the issuing Certificate Authority", etc. If you don't, just close it and double click again. Now just proceed through the dialog choosing "Request a certificate from an existing CA" - Continue Request is "Saved to disk" - Continue Save it where ever you like, even override the file.

At the end you should see the magic "Creating key pair"

Run over to the KeyChain access and you'll see your keys in there! Upload this certificate to the apple portal and then go through their wizard as normal, everything should work great now.

There are two different certificates for two different provisioning profiles (development and distribution). You have to install BOTH certificates in keychain. In the iPhone Developer Program Portal:

Certificates -> Development -> Download Certificates -> Distribution -> Download

Double click both certificates. After that both certificates must appear in Keychain.

"This was a bug on the Apple portal site. They were missing a necessary field in the provisioning profile. They fixed this bug late on 6/16/09. "

I had the exact same problem and tried everything. For whatever reason the solution was that all my certificates had migrated to a keychain called "microsoft_intermediate_certificates". As it probably happened during an Xcode upgrade I have absolutely no idea why, but it may help somebody.

I moved all content of the Microsoft keychain to the login keychain and everything went back to normal.

I finally got this to work after, like, 4 separate tries after incurring the same problem that was originally posted. So here's what happened, I am not sure if this is an old issue now (2009-07-09), but I will post anyway in case it is helpful to you. What worked for me... might work for you...

  1. start anew and delete the old private keys, public keys, and certificates in the keychain
  2. go through the whole process, request a certificate from a certificate authority, get a new public key, a new private key, and a new certificate. Note: when it worked I had exactly one private key, one public key, and one certificate
  3. Make a new provisioning profile (which utilizes the certificate that you just made) and put that in your organizer window in Xcode. Delete all the old BS.
  4. Run it.

Hopefully this helps.

Everyone here is very wrong. All you need is to follow the steps that Apple provides in Managing Your Digital Identities.

It instructs you to export your certificates through Xcode and reimport through Xcode. It works great, but make sure your username is the same on both computers or it will fail.

For Xcode 13 (maybe earlier?) - The key to this is to use the "Build Settings" tab, not the "Signing and Capabilities" tab in your Target Settings. Once you are in "Build Settings", search for the "Signing" section (you can type "Signing" in the search box). There you will see a sub-section called Code Signing Identity. In that section you can click on each line and directly choose any certificate you have in your keychain. You need to do that for all of the relevant configurations (the ones that you want to upload to TestFlight/AppStore). When you go back to the "Signing and Capabilities" tab, you should see the results of what you did and the error should have gone away.

I got inspiration from this answer (below): https://stackoverflow.com/a/37043501/826946

But I thought that having this laid out explicitly might help.

Related