Iphone – Code Sign error: The identity ‘iPhone Developer’ doesn’t match any valid certificate/private key pair in the default keychain

iphonexcodexcode4

I am trying to create an ad hoc distribution of my App to send to a colleague.

I am getting the following error when trying to Archive my project for distribution:

Code Sign error: The identity 'iPhone
Developer' doesn't match any valid
certificate/private key pair in the
default keychain

These are the steps which I have followed:

  1. I have registered the device in the provisioning portal.
  2. I have generated a certificate signing request in keychain.
  3. Using this I have created a DISTRIBUTION certificate in the portal and dragged in keychain and I can see the key under the name.
  4. I have then created a DISTRIBUTION profile in the portal and downloaded it and dragged it into Xcode organiser. It appears to be valid in Organiser as there are no warnings.
  5. Now in the project properties I have choosen this profile in the code signing identity.

Now when I run i get this above error.

Best Answer

It appears as if the profile has not been selected. Still "iPhone developer" is selected. Sometimes when I change it in my project properties, it doesn't automatically get reflected in target properties, so double click on your target and set the profile there.

Some more steps you may have not done:

  1. I hope you are doing this all for "Distribution" configuration
  2. You have set your identifier in bundle of target properties as the identifier that you have given in profile, i.e. something like 'com.domainname.appname".