iPhone signing problem: Private keys "disconnected" from developer and distribution certs - iphone

From time to time, may iOS developers experience the problem of being unable to build their apps for deployment to a device because the Keychain seems to forget that their developer certificate is associated with their private key. Both the developer cert and the private key are present, but they don't show up "under" each other as they should.
Ditto for the distribution certificate. It can get disconnected from its private key and XCode will refuse to work.
Searching the web reveals dozens of versions of this question being asked here and elsewhere. The result is either "Hey, this morning it works!" or the thread goes dead and there's no answer. (Alternative to the former is "I rebooted and it works" or "I re-launched XCode and it works".)
The answers I previously received before were all "read Apple's exemplary and flawless documentation". Well, I've been there and I've done that. Like I said, this was all working fine and now it doesn't. Nothing changed. It does this 3-4 times per year. In the past I was one of those "I re-launched XCode and now it works" guys but this time no amount of dragging, dropping, relaunching, or re-booting will work.
I'm looking for suggestions.

I am not sure what is causing it for you, but I know one way to fix it. I just installed lion and went through the same thing. I simply went to the Apple Developer portal, deleted my developer certificate, followed their tutorial (which shows up when you create a new developer certificate). This basically had me generate a new CSR (Certificate Signing Request) in KeyChain. Uploaded the new cert, then had to go into my apps and make new dev profiles with the new certificate.

Related

ios - provisioning profile issues

I recently re-installed my mac for a good spring clean and did a complete backup with Super Duper:-)
Now on the day I did the re-install Apple's servers had issues with signing certificates, which I didn't know and thought I was messing things up. So I deleted all of them from my account and thought to start over again.
I have them downloaded, but obviously they are not on my account anymore.
Now I have an update for an app in the app store and no matter what I try, I can't sign the app to make it ready for the upload. Have I completely stuffed this and do I need to make a new app in iTunes Connect?
PS I do not believe this question is under NDA - if it is I am happy to delete it, I have also posted this on the apple forum, but I am seem to get quicker answers here:-)
Thanks for your help.
Whatever you do DON'T make a new App. This is simply a provisioning profile and signing certificate issue. Just go through the process of setting those up all again. And then make sure your Project knows to use the NEW ones and does not have references to old ones in Git or whatever source code control you use.

Code Sign error - Iphone Debuggin

I have big problems.
I'm new on a small company and now I'm in charge of the iPhone developing.
Because I'm new and everything isn't clear on my work area (I had 7 Provisioning Profiles, for example), and I wanted to restart, so I opened the Keychain Access and deleted all Certificates, all My Certificates and all Keys.
Now I know it was a mistake I deleted my Keys, right?.
I went to Apple Developer Site and download all the Provisioning Profiles and Certificates, but I canĀ“t make it work.
When I try to debug on my Real Device, it shows me "Code Sign error: The identity 'XXXXX' doesn't match any valid certificate/private key pair in the default keychain" error.
After reading over the internet I think my problem was deleting the keys, right?.
I lost the key for the certificate, right?
What can I do?
The system's previus version is on the Apple Market, so I can't delete the certificate and create a new one, no?
I really need help. I'm new and this proccess is really difficult for me.
Thanks and sorry for my poor english.
You can savely revoke the certificates in the provisioning portal and recreate them with a new private key. This won't affect already released apps. After that just sign your apps with the new created certificates that match your new private key.
Just follow the steps on the "How To" tab in the provisioning portal if you get stuck.
I don't know whether I can help you, as I am also new, but still making a try ..
First, you yourself understand that you should not delete ALL profiles from keychain. But, you may, certainly, delete the profiles that get expired (it shows a small red cross on the profile name if it gets expired). Now, though you have deleted all from keychain, you CAN get them back. You must have a *.cer file as you downloaded all profiles from developer site. You also have a *.p12 file. On click on both to use the certificates. In one case, you will need to provide password (I don't remember which case, sorry). Put the password and you will find them in keychain.
Now, connect your device to Mac, collect also the information to the device using Organizer. To open organizer, go to Xcode->Window->Organizer. Here, click on Devices. On the left pane, You'll see 'Provisional profiles'. Click on it. Now you can see which provisional profiles are installed. Click on any one of them. Note the app identifier. It may be in this format 'ABCDEF.com.YourCompany.*' . Copy this part 'com.YourCompany.' and paste it in your code->info->Bundle Identifier (before $PRODUCT_NAME).
In build settings, now you'll be able to find the developer profile.

Archive - Share resigning is using old provision

So my distribution certificate expired (happy anniversary) so I had to go through the fun of new cert, provisioning profiles, etc. Everything seemed fine, made the new build and sent it to my client, and the the fun started.
he kept getting the dreaded "entitlements are not valid" message. I knew for a fact that his device was on the ad hoc mobile provision (i even opened it and found the device id in question)
After banging my head on my desk for a couple hours, trying cleans, rebuilds, redoing the cert, profiles, etc, all to no avail, i noticed the "dont resign" option on the share dialog in the organizer. I said what the heck and gave it a shot. much to my surprise, that ipa worked like it was supposed to.
so the only logical thing i can think is that the provisioning profile organizer wants to use isnt the one i actually signed it with, but the old one. that said, i have cleared the old one off the system completely (out of organizer, the file is gone, no longer referenced in the project)
so everyone is happy now, they can test this version, but i hate not knowing why (plus its going to be really annoying every time i have to select that option)
anyone have any ideas as to why and how to catch organizer up?

Updating application with new certificate

To make a long story short: I have developed an application for a company and I was about to update when I discovered that in the member center area on the Apple website the Development Certificate was gone, as well as the devices and other stuff, so I made a new one and uploaded the device ID again.
So everything okay...I thought. I opened iTunes and downloaded the new provisioning profile and dragged it over to the organizer window. But it did not work. I got several different warning and errors saying the the keys, certificates etc did not match, so I Googled. I saw some posts that said: try making a new distrubution certificate...so I did, then xcode told me that I had to many certificates for that app so I exported the certificates by right clicking the selected certificates in the keychain and tapped export. I ended up with a Certificates.cer file. Then I deleted those certificates to make room for the new ones i downloaded from the member center portal.
SO now I do not know what I have done...I am afraid that I screwed something really up.
My question is: I really hope it is still possible to update the application already in appstore even though I have to recreate the certficates, provisioning profiles etc.
Best regards
You can alway start from scratch, deleting all the provisioning profiles through your developer member page, recreating the profiles you need, importing them in Xcode and rebuilding the app with them. You cannot screw things that much, not being able to publish the app once again.
Clear all the contents of Xcode, and of your provisioning profiles page, and start over. Things will work. I've done this tens of times.

I'm in an iPhone provisioning mess -- Insight needed

My app has been more or less ready to be submitted for a while now, but as usual, the overly complex provisioning nonsense that Apple forces developers to jump through is causing me an enormous amount of stress. Initially the problem I was receiving was Invalid Codesign. After trying every 'solution' i could find on the internet and failing, I decided that it would be best if I started fresh -- Deleted all my provioning profiles, cleaned up my itunes connect account, deleted all my keys and certificate from the keychain access and started from scratch. The problem is that once I deleted by keys and developer certificate from the keychain access, I cant get them back!!! I've tried restarting, I've tried installing it every way imaginable, but I just cant get anything to be listed in the 'keys' nor 'my certificates' sections of the keychain access. I do have an iPhone edveloper profile in the 'certificates section' but this doesnt even seem to be of any use because when I look in the Organizer there are no developer profiles listed, and all my provisioning profiles warn "A valid signing identity matching this profile could not be found in your keychain"
Someone please help me through this mess. I've been developing my app for several months now and I already have an app in the App Store but Apple insists on making this process damn near impossible. Thanks so much!!!
Your public and private keys are automagically generated when required - if you use the certificate assistant to request a signing certificate as the provisioning profile describes you will find your new private/public keys created.
Once you begin this process you should also use spotlight to remove all .mobileprovision and .cer files you may have remaining in downloads, and also use organizer to remove profiles from devices. If you are starting from scratch you want to make sure none of that stuff remains to cause you problems.
This is an overcomplicated process to be sure, but once everything is really deleted and a fresh start is made it should be good for some time. The biggest problems I have had are when getting a new Mac and having hiccups with exporting/importing keys in an effort to keep my old certificates/provisioning valid.