iPhone Provisioning Question - iphone

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.

Related

Any Issue With Revoking Certificate Regularly

Is there any issue, if I revoke my development certificate regularly (10 times / month) ?
Let consider I'm developing 3 application using different systems with 1 development certificate and 3 provisioning profiles. Regularly I'm adding new devices to all our provisional profiles .
When installing provisioning profile in other 2 machines, Xcode Organizer shows an warning as "A valid signing identity matching this profile could not be found in your keychain " . So i just revoked my earlier certificate and generated new certificate request from the same machine keychain. After downloaded the new certificate, all things seems to be ok.
However other machines Xcode organizers will display the same warning when try to modify and download the provisioning profiles. So always I will fix the issue this way (revoking & regenerating new one).
So I would like to know, is there any issue, if I revoke my development certificate regularly (like account ban/block etc)?
There is no need to revoke your certificate every time.
On the system where the development certificate is installed, go to Key Chain Access and select the both certificate and key, right click to get the option to export, and then export as a file to your desktop. Now send that .p12 file to another Mac where you can double click that .p12 file to have it install in in that system's Key Chain Access. You install the certificates in just the same way, and once you have done that it will not show that message.

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

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

error creating ipa

I tried to follow this video to make an ipa
http://www.youtube.com/watch?v=gRhtsnFB0bM
but I have an error when I want to make Product > Archive
[BEROR]Code Sign error: The identity 'iPhone Distribution' doesn't
match any valid certificate/private key pair in the default keychain
It's the first time that I do that so I don't really know how it works, but I think it's a certificate problem. I made the app for someone. I downloaded his certificate from his account in developer.apple.com, what shall I do with it? Shall I make something in xcode to add it?
you need to revoke the previous provisioning profiles in his
account..(if you can get the previous person keychain files ..that
get that and install in your keychain..compiling will be successful)
make a new distribution certificate using keychain in your mac
and then make a new distribution profile using that distribution
certificate..then you will be able to compile using that profile.
I get this error all the time since I use the same scheme for testing as I do for distro. You will have to go into your build settings for the project and the target and set the code signing back to iPhone Developer. Clean your settings and rebuild. That should do the trick.

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