I finally succeeded in building my first iPhone app but now I am pulling some hair out over a code signing problem.
This is the error message I get when I try to build the code in Xcode for my device –
Code Sign error: The identity ‘iPhone Developer’ doesn’t match any valid certificate/private key pair in the default keychain
In the organizer, I have a warning –
Xcode could not find a valid private-key/certificate pair for this profile on your keychain.
I have tried the following things –
-
I have deleted and re-created all the certificates from my Provisioning profile on developer.apple.com
-
In Utilities->Keychain, I have deleted the certificates from the System Keychain. The certificate is stored only in the login keychain.
-
I have re-started my Xcode and also my Mac
-
In the target, code signing section I have tried both iPhone Developer and also iPhone Distribution. For some reason the provisioning profile that I created has been grayed out.
So now I have no idea what’s going on and don’t know what to do. I’ll appreciate any help.
Thanks a lot.
In addition to the provisioning profiles, you also need the private keys for your developer account (one for development and one for distribution).
The provisioning profiles list all of the devices which the app is able to run on. But the actual app is signed with your account’s private key. This key is not stored in Xcode, it’s stored in Keychain Access (to ensure it’s encrypted with your user login credentials).
At some point you will need to repeat those steps, but for the “Distribution” tab of the certificates section.