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

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.

This question is related to ios xcode

The answer is


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


Here is what I did.

  1. Make sure your certificates have not expired, make sure you delete all the expired ones. Get new ones etc, Once you have make sure all that is the way it should be, then focus on your project files.
  2. in finder , go to your .xcodeproj files then show package contentes.
  3. open project.pbxproj in xcode or textedit.
  4. find every refrense to PROVISIONING_PROFILE and remove the GUID, just leave empty "" Depending on your project you should have about 12+ refrences, remove all of the GUIDS.

  5. Save file, then reopen your project in XCODE

  6. Re select the correct provision profiles for all possible code signings( they should not all be the same)
  7. Build your project and you should be good to go.

I think Xcode gets confused some how, and removing all the Provision Profiles from the project.pbxproj and then reselecting a valid profile will set it striaght.


In my case, I copied the project from my iMac to my Macbook Pro and found out I didn't have my private key installed on the Macbook. So I exported my private key, copied and installed it to the Macbook, and voila it works! I've documented the information here: http://www.creatistblog.com/2009/09/iphone-developer-provisioning.html


Just a note with Xcode 4: in the organizer there are two different sections in the left pane:

  1. Library > Provisioning profiles

  2. Devices > your device > Provisioning profiles

I was always puttings my provisioning profiles into 2. and even after cleaning and installing properly it was not working. Then I discovered 1. and finally I found the refresh button. If you select 'Automatic device provisioning' in 1. and click on refresh, then everything got validated (no yellow warning in 2. anymore).


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.


Was facing a similar issue yesterday with our CI server. The app extension could not be signed with the error

Code Sign error: No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier XXX were found.

Note: I had created my provisioning profiles myself from Developer portal (not managed by Xcode).

The error was that I had created the provisioning profiles using the Distribution certificate, but the build settings were set to use the developer certificate. Changing it to use Distribution certificate solved the issue.

enter image description here

Summary: Match the certificate used for creating the provisioning profile in build settings too.


For development certificates you can just create a new one and match it to a profile. However for distribution, like when your going to submit to Apple, you cannot do this and must use the distribution certificate the team agent created. The problem is you need the private key on your machine. It's very simple, however, for the team agent who created the certificate to copy the private key to you, below are the instructions from Apple, I hope this helps.

It is critical that you save your private key somewhere safe in the event that you need to develop on multiple computers or decide to reinstall your system OS. Without your private key, you will be unable to sign binaries in Xcode and test your application on any Apple device. When a CSR is generated, the Keychain Access application creates a private key on your login keychain. This private key is tied to your user account and cannot be reproduced if lost due to an OS reinstall. If you plan to do development and testing on multiple systems, you will need to import your private key onto all of the systems you’ll be doing work on.

  1. To export your private key and certificate for safe-keeping and for enabling development on multiple systems, open up the Keychain Access Application and select the ‘Keys’ category.
  2. Control-Click on the private key associated with your iPhone Development Certificate and click ‘Export Items’ in the menu. The private key is identified by the iPhone Developer: public certificate that is paired with it.
  3. Save your key in the Personal Information Exchange (.p12) file format.
  4. You will be prompted to create a password which is used when you attempt to import this key on another computer.
  5. You can now transfer this .p12 file between systems. Double-click on the .p12 to install it on a system. You will be prompted for the password you entered in Step 4.

After carefully going through the thread here and checking all the solutions proposed by people, I can confidently claim this, after following the steps mentioned on Apple developer docs for creating CSR and mobile provision file, just do this!,

  1. Launch Xcode.
  2. Select window->Organizer
  3. Click this refresh button and that filthy yellow bar will remove instantly.

http://img.skitch.com/20100820-1ngm8an14c6fm3dt7g6j51d2nx.jpg

Trust me, you only have to do this. There is no need to repeat the process again and again to make sure that you doing it the right way. Just press Refresh, enter your login credentials and it's done.


I just spent several hours on this fershlugginer issue, which cropped up after renewing my development license. To reiterate, everything was working without a hitch, then (thank you Apple!) it all got screwed up and stayed screwed up. None of the Apple official troubleshooting steps (linked to above) or possible resolution steps mentioned here resolved the issue for me.

What finally did it for me was to delete both my development and distribution certificates, revoke them in the provisioning portal, and then let Xcode AUTOMATICALLY refresh/issue them. Nothing else, in any order, was able to get both required certificates into my keychain with the private key correctly attached.


I had this same problem but, it was due to my setting up "FileVault" on my Mac. I went into my keychain and set "login" to be my default and that fixed it.


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.


Because I keep coming back to this question, I will leave my answer here for the solution that works for me. It turns out that for a same public/private key developer identifier of me, it's installed twice in my keychain. Both have private key. But when I compare, one is private key of me within my developer organisation, and another one is private key of me as a personal developer. It turns out Xcode keeps trying using the wrong key. Removing the wrong duplicate key solves all the problem. Hey future me, check this one first next time!


I solved it by

a) go to provisioning profile page on the portal

b) Click on Edit on the provisioning profile you are having trouble (right hand side).

c) Check the Appropriate Certificate box (not checked by default) and select the correct App ID (my old one was expired)

d) Download and use the new provisioning profile. Delete the old one(s).

Apparently there are 4 different causes of this problem:

  1. Your Keychain is missing the private key associated with your iPhone Developer or iPhone Distribution certificate.
  2. Your Keychain is missing the Apple Worldwide Developer Relations Intermediate Certificate.
  3. Your certificate was revoked or has expired.
  4. Online Certificate Status Protocol (OCSP) or Certificate Revocation List (CRL) are turned on in Keychain Access preferences

.


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.


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.


I solved it. I had to drag the .cer files into KeyChain Access. But make sure "Login" is selected in the upper left. If not, Xcode will not see the cert and will not be able to sign your code.

Apple has some room for improvement in this department....


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.


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.


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.


I don't know whether they really skipped it or if my eyes were just glazing over but....

Just in case anybody else is overlooking the same things that I did....

just as when you were developing and testing...

1) You need a DISTRIBUTION << CERTIFICATE >> 2) You need a DISTRIBUTION << PROVISIONING PROFILE >>

That is TWO STEPS on the portal in order to get the thing signed.

There I was, having created the developer CERTIFICATE and copied it to the Mobile Provisions folder, wondering why it didn't work.

As soon as I had the provisioning profile in place

* BINGO *


What you need:

1) A private and a public key.

They have this symbol in your keychain:

alt text

2) A certificate made from the signing request of those keys

3) A provisioning profile linked to that certificate

Let's say you change computers and want to set up Xcode with provisioning profiles again. How do you do it?

  1. Open Xcode, press ctrl + O to open the Organizer, and delete all provisioning profiles you might have installed already.
  2. Open keychain access, and create a signing request which you save to file (when you create the request, a private and public key is created in your keychain).
  3. Create/Update a certificate in the provisioning portal by sending apple this signing request
  4. Download and install the newly created certificate.
  5. Revoke your provisioning profiles and update them with the new certificate.
  6. Download and install the newly updated provisioning profiles.

If you have new mac you can go to IOS developer center --> Provisioning Portal --> Certificates --> Development --> Revoke and create new certificate. My problem solved. My error is "Code Sign error: The identity 'iPhone Developer' doesn't match any valid, non-expired certificate/private key pair in your keychains"


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.


A good way to ensure that this happens cleanly is to clean your login keychain completely first.

Also, a really important step is to unlock your keychain before you import the private key and public key

 security unlock-keychain -p password ~/Library/Keychains/login.keychain 

Import private key into login keychain :

security import PrivateKey.p12 -k ~/Library/Keychains/login.keychain 

1 identity imported.

Import public key into login keychain :

security import PublicKeyName.pem -k ~/Library/Keychains/login.keychain 

1 key imported.


The answer is this revoke your Current Development Certificate and make a new one. follow the instructions on apples site on how to do so. Its that simple!! I had this exact problem.


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.


I logged into developer account and revoked the development certificate. After revoking and downloading the development certificate i double clicked the newly downloaded certificate and this time Private Key was there under development certificate in KeyChain Access.


"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 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!


Simple steps to get this done:

  1. Start from keychain (which contains your dev key already) on your computer and create a request for certificate. Upload the request to dev site and create the certificate.
  2. Create a profile using the certificate.
  3. Download the profile and drop it on Xcode.

Now all the dots are connected and it should work. This works for both dev and distribution.


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.


Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to xcode

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 iPhone is not available. Please reconnect the device Make a VStack fill the width of the screen in SwiftUI error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Xcode 10: A valid provisioning profile for this executable was not found Xcode 10, Command CodeSign failed with a nonzero exit code