Reputation: 1300
You might think, not again such a question where are already thousands of topics about. However, I've not been capable of finding the answer I needed to fix this problem.
None of these topics go as deep as the Keychain.
When I'm trying to deploy my app to an iPhone, I'm receiving the following message:
Code Sign error: The identity 'iPhone Developer: [Name] ([ID])' doesn't match any valid, non-expired certificate/private key pair in your keychains.
Now, as said, I have been looking for multiple guides or fixes, however, none of them seemed to fix this issue.
Things I've tried:
After trying all of these ways, I've still not been able to solve the issue. One problem I've seen is that at first hand, the certificate in the Keychain was showing an invalid status, which is now solved.
However, if I'm right, there are supposed to be two keys attached to the certificate. A public and private key, and these are not showing.
Neither are there any keys showing in the Keys tab in the Keychain Access.
(Thanks to nsgulliver)
Upvotes: 6
Views: 28140
Reputation: 5478
After removing all old provisioning profiles (~/Library/MobileDevice/Provisioning Profiles/
) and updating xCode, the certificates can be found again.
Upvotes: 0
Reputation: 125037
Required reading when you're having code signing problems:
Technical Note TN2250: iOS Code Signing Troubleshooting
Nothing will help you more than really understanding what's in your certificates and what isn't, where the necessary pieces are kept, and how they're used. This isn't the last time that you'll have code signing issues, and this tech note provides a long checklist that should help you make sure that everything is in the right place to help you develop your app and ultimately sign and submit it to the app store.
Upvotes: 1
Reputation: 12671
Provisioning profiles installed on the devices or signed with for the target might not be valid, try to go to Organizer->Provisioning profile
and see if the profiles have the valid status? if not try to delete & refresh them, if they appear valid after refreshing then it might solve your problem if not then you should remove all the entries from keychain
and delete profiles on your provisioning portal and try to create from scratch, if you still face the problem then take help from step by step guide tutorial
Upvotes: 3
Reputation: 123
When I've had this problem in the past I've just deleted everything on my local machine and started again. So:
I find that this is the quickest way to fix any provisioning / key problems, as you can spend hours finding that you've missed something small.
Upvotes: 0
Reputation: 73966
You cannot re-create matching keys, that would defeat the whole purpose of them. You need to find the old keys or start the signing procedure from scratch.
Are you using the same machine that you generated the keys on? If not, go to the other machine, export the developer profile, then import it on the new machine.
Can you restore the keys from backups? If not, stop everything you are doing and configure your computer for backups before you do anything else.
If you are really stuck, you will have to follow the signing procedure right from the very beginning, where you request a certificate from a certificate authority. This will generate new keys, and you will have to create matching provisioning profiles, then set your application to be signed with these. Dlete the old provisioning profiles, they will be useless without the old keys.
Upvotes: 2