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

I recently had my old hard drive crash and had to reinstall everything on my mac. I've finally gotten everything working again, except for running iOS apps on my iPhone, I keep getting the error:
Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain
I know this has something to do with the keychain, but I did it so long ago that I don't remember what the steps were (and I don't even think the steps would be the same again in this case). Any ideas how I can install my iOS apps on my phone again?

Since your hard drive crashed, all your certificates in keychain are lost. So you can't codesign your apps with same certificate again. You need to revoke the certificate from provisioning portal, update provisioning profile from portal with this certificate then download it. Re code sign your apps with this certificate.
When you first created certificate on the mac it gets installed into keychain access. You SHOULD backup private key and cert in case of events like this.Downloading provisioning profile from portal is not the same.
Going forward to save yourself from this: go to Xcode organizer -> Library -> Developer Profile -> Export then save that profile somewhere safe. Just in case you crash your hard drive again you can import this profile to new machine and save yourself from going through certificate revocation.

You need to generate a new signing certificate. When you did this before you created a private/public key pair that were stored in your Keychain. When your hard drive crashed the private key was lost so you can no longer sign apps with the old certificate hence the need for creation of a new certificate.
Follow these steps: http://developer.apple.com/ios/manage/certificates/team/howto.action

Related

getting Code Sign error when updating the application

I want to update my application in app sotre.... I again downloaded the Distribution certificate and distribution provision profile and try to build with that..
But its giving me error
Code Sign error: The identity 'iPhone Distribution: Mobilesoft LLC' doesn't match any valid certificate/private key pair in the default keychain.
At the time of submission i myself created the certificate. I want to ask if i create it again then build with new certificate does it effect anything if i update with the newly created certificate.
Thanx...
Create a new certificate and also create new provisioning profile with this new certificate and previous bundle identifier. It will work properly.
You probably don't have the private key any more. If you can't find this, you can revoke and recreate your distribution certificate and provisioning profiles. This will not affect apps currently in the app store.

Issue with transferring of developer certificate and Provisioning Profile under Xcode

I am trying transfer my developer certificate under the keychain to someone. I exported the item. And also send him the provisioning profile which includes his device ID.
He installed my certificate to his keychain and also the provisioning profile to his xcode.
However, The provisioning profile under his xcode complains of there's no Valid signing Identity. Well I already sent him the certificate.
What's wrong?
You have to export the matching private key with the Developer Certificate, you can select both the private key and Certificate and export at the same time.
Does he have multiple certificates with the same name in his keychain? In which case he may have to delete the one that is not applicable for this profile when he is trying to build the app (he can reinstall the deleted certificate later). Also, ask him to delete and reinstall the profile. Is there any more information he is getting with the error?
Along with the development & distribution certificates that you provided, you also need to export your private key as a *.p12 file. When he is importing this elements into the Keychain application ensure he selects the "login" keychain.

Multiple Certificates/Provisioning Profiles in one Xcode organizer?

There are several similar questions here, but none could answer my basic question:
Is it possible to have two separate developer certificates in the keychain and two corresponding distribution profiles in Organizer?
I have my own (working) developer certificate and provisioning profile for my own iPhone apps.
Now I finished a project for a client and would like to use his developer account/certificates/provisioning profiles to submit his app to the app store on his account.
Is that even possible?
So far I downloaded and installed his certificates and they show up in my keychain, and I installed his provisioning profile in Organizer, but Organizer tells me "A valid signing identity matching this profile could not be found in your keychain.".
Likewise, the archive build fails.
I couldn't find a way to tell Organizer to use the certificate of my client instead of my own-I think this is the problem.
Thanks for any help!
Yes I've produced app store builds of projects for clients several times using their distribution certificate. No need to use their developer certificate. There are many things can could go wrong here, if you have access to the client's account you can go on to the provisioning portal and check things out:
make sure the bundle ID in the project settings exactly matches the app ID on the iOS provisioning portal (com.company.appname usually)
make sure the app store distribution provisioning profile is marked as "valid" and shows up under the distribution certificate.
make sure the app store build config in xcode references the client's distribution cert.
open your keychain and make sure that the client distribution cert also has its accompanying private key. This may be the problem, it's the part usually left out. The client must export his private key for his dist cert and send it to you in the .p12 file along with the password to the .p12 file. The dist cert can't be used to sign the app without the private key!
sometimes just quitting Xcode and restarting it helps.
See this solution to duplicate certificates: http://tapadoo.com/2012/certificates-magically-re-appearing-in-your-keychain-try-this/
The gist is that if you have an old private key and provisioning profile around, you can run into a case where Xcode will re-create an old certificate in your keychain. This will make code signing gag because it requires a single certificate with a given name. Deleting the old private key will resolve this issue.
EASY MODE
(I hate these archaic export errors so bad. So many hours wasted. I'm not religious but I still pray this helps you)
Log into https://developer.apple.com
go to Certificates, Identifiers & Profiles
bottom left: Provisioning Profiles
Delete any duplicates / invalid profiles (in my case I only had one but it was invalid)
Note: if you're trying to export an archive, you can leave the export window open, delete a provisioning profile, then click "retry" or whatever the button says. This will save you from have to re-archive over and over
#xcode8.2.1 #osx10.11.6

iPhone Provisioning Question

I've recently reinstalled OSX, and now, when trying to build a new version of my already active app, I'm running into issues. Firstly it is complaining:
Code Sign error: The identity 'iPhone Distribution: Joshua ONeal' doesn't match any valid certificate/private key pair in the default keychain
So, I realized that I deleted my certificates. So I went over to developer.apple.com, and redownloaded the WWDR Certificate, my development certificate, and my distribution certificate. All 3 installed into Keychain with no issues. Now, when I try to download the team development provisioning profile, and the app specific distribution provisioning profile, and install them, they both throw the following error in XCode's organizer:
A valid signing identity matching this profile could not be found in your keychain.
What gives? Am I missing a certificate? Or, do I have to revoke them at dev.apple and recreate them with my fresh install?
Thanks a lot, this is very confusing, and it is stressing me out that I can't get a bug fix out asap.
UPDATE:
Here is what fixed it for me.
Revoke the developer and distributor certificates, as well as the two provisioning profiles.
Open Keychain Access, and delete the old certificates.
Create 2 new certs, and 2 new prov. profiles, and install them.
Open XCode, go to the app's target on the left side, get info, update the two code signing options to use the new certificate.
Clean all targets, build and archive.
You'll need the matching private key to go with your certificates. If you did a fresh OS X install, you will have erased the private key you used to create the initial signing request. The solution is as you suggest to revoke your current certificates and generate new ones with a new signing request.
To avoid this happening in the future, you can export the private keys you create in Keychain and back them up somewhere to use in the future if you want to develop on a new computer or fresh install.

generate new Certificate Signing Request after upgrading to Snow Leopard?

i recently updated my mac to Snow Leopard. But due to it all my provisioning profiles have been deleted. I didnt keep the backup for my keychain so i downloaded my Certificate Signing Request again from apple developer program and installed it in my mac.So to upload one of my old application i created a new App Id with a new Provisioning profile..I did not have MobileDevice folder in my Library so i created it manually and copied the profile to that folder..Now in my xcode when i try to select my provisioning profile it does not show any.I selected the Iphone Distribution profile(Xcode3.2 might automatcally detect it) but it doesnt work.I manually entered the name of my profile via other but still it gives me error.
Code Sign error: The identity 'iPhone Distribution' doesn't match any valid certificate/private key pair in the default keychain
Do i have to create a new Certificate Signing Request for Os 10.6??
Or creating MobileDevice folder manually wont work??
What should i do??
I think you have to generate a new certificate. Unless you exported your previous certificates with your private key.