Code Sign error - Iphone Debuggin - iphone

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.

Related

iPhone developer doesn't match any valid certificate (Xcode)

Hi I've kind of been cornered by apple here, I submitted a technical support query, one of the free ones thats comes free when you pay into the developer program only to be told that they won't be in the office until after Thanksgiving, a problem I overlooked as I am from Ireland. I really need help on this as I've tried looking in forums and I've tried solutions that were given for similar problems but I still can't crack it.
The screenshot images can be seen on this page..
http://www.heffernanwebservices.ie/blank.html
Here it goes...
DESCRIPTION OF PROBLEM On trying to build my project "Mulligan IRL" in xcode i get the following error " Code Sign error: The identity 'iPhone Developer: Cian Heffernan (8ELM27DL8F)' doesn't match any valid certificate/private key pair in the default keychain"
[Screenshot 1]
When I navigate to code signing in the build settings of the project i can see that when I click code signing identity for iphone developer or iphone distribution it has "(no profiles currently match) beside them. I then headed to the keychain access window in utilities and look in certificates and find that both the developer and distribution certificates will not expire until next August and November. Next I headed to the organizer in xcode. I see in provisioning profiles I have 8 profiles there! I don't know why I have so many.(2nd attachment)
[Screenshot 2]
As you can see ONE of the iOS team provisioning profiles will expire in 11days so I just tried to renew that. When I try this I get an error:(3rd attachment)
[Screenshot 3]
I then head to the provisioning portal to see why it wasn't found but I can see the profile. (4th attachment)
[Screenshot 4]
I have no idea why I am getting this error. I would appreciate any help on the matter.
For certificate to be valid it needs to be associated in your Keychain with a private key. Find the "iPhone Developer..." certificate in your Keychain and see if it's got a private key associated with it.
This can occur when you develop on two or more computers. You need to export the certificate+private key pair from the computer where you generated the private key first. Then import it onto all computers you do development on.
See Apple's Transferring Your Identities for more detailed info.
This could be caused by not having the private key associated with your certificate in your keychain. You can verify this by going to Keychain Access and choosing "Certificates" from the "Category" area at the bottom left. If your developer certificate does not appear when filtering that way, you are missing the private key for it.
If this is the case, you'll have to add your private key to the keychain, or else just reject and re-issue your development certificate with a new private key (you can find steps for this in the provisioning portal.)
a useful link from Apple about the submission process. hope it helps
I was using AppCode, but for me simply adding a new Keychain via Keychain Access called iPhone Developer allowed me to start building in AppCode.
Apple has a great article regarding Certificates and Provisioning-Profiles,
with excellent troubleshooting:
iOS Code Signing Troubleshooting
The most useful part I found was regarding cleanup of old provisioning-profiles from Xcode:
"Keep Your Profile Library Clean
...You need to manually remove provisioning profiles you are not using,
otherwise, Xcode will reimport potentially old or duplicate certificates into the keychain
and that can cause build errors."
And as a weapon of last resort, you can use this procedure:
How do I delete/revoke my certificates and start over fresh?

Unable to delete a developer's certificate

I mistakenly imported someone else's certificate(with his priv key) to my mac, and now I have two developer's certificates shown in my xCode. When I delete the unneeded certificate with its key in "Keychain Access", both the cert and the priv key magically reappear after sometime, how can I get rid of this? Is it automatically imported from somewhere e.g. the iphone developer's site?
Have you tried deleting from iPhone Configuration Utility app? It never comes back when I delete it from there.
EDIT: You can only delete provisioning profiles from iphone configuration utility app. To delete certificates/keys, you have to use keychain access.
Note that when you add a provisioning profile, all the associated certificates are added to your keychain as well. So deleting a certi won't help you, and it will always come back as in your case. All of them.
Here is a blog post that I had written for some code-signing insight. Here is a quote from this post:
Now, when you download a profile to your machine, all the associated certificates also get added to your keychain. You can check that under "Certificates" category in the keychain app. But unless there is at least one certificate with the corresponding private key in your keychain, you wont be able to sign the app.
Point is, it is the private key that xcode looks for for the certificates that you already have. Since you have a private key, xcode lists that as a available option for signing. So, its the private key that you want to delete and not the certi. So go to Keys section in the keychain access, find the culprit key, and shoot it.
XCode automatically does this if you log in on xCode with your developer's username and password.
It will generate a team provisioning profile and automatically download and install it.
To change it, go to the apple provisioning portal (http://developer.apple.com)
You need to open the "Keychain Access" app which can be found in the Utilities folder. In the "My Certificates" category, you will find all stored certificates on your machine and can easily right click and delete the certificate & private key.

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.

Two AppStore Accounts With The Same Name. I got codeSign error 'Name' appears more than once in the keychain

I got another new account for the AppStore, I setup the new account certificates on my MAC. Now when I try to publish XCode gives me the error
CodeSign error: Certificate identity 'iPhone Distribution: 'Name' appears more than once in the keychain. The codesign tool requires there only be one.
How can I change my certificate identity for the other account? While I have to leave my Name as it is on both itunes profiles.
How can avoid this problem without have to remove one certificate each time I need to publish app on appstore.
Thank you.
Look in the keychain app on your Mac. You may have expired entries as well as current entries. Delete the expired entries and you will be okay. Worked for me today.
I create a keychain for each team, and put all the related files (public key, private key, certificate) for the team in the keychain. The only downside is that you have to set your default keychain to the team keychain when building for a device.
I have just had this problem, and my current temporary solution was to export then delete one of the distribution identities, leaving me with one identity which then XCode is happy with. So I will have to export, delete, and import each time I want to switch to a different project to make a distribution, which isn't ideal.
I am still looking for a nicer solution.
The keychain approach sounds ok in principle, but in practice it appears to be require using the "Reset the default keychain" option in Keychain Preferences, which I have not tried yet but doesn't sound like a low-risk activity.
I did publish multiple apps on multiple app store accounts using multiple certificate (for the same identity, aka "me") and Xcode manages to understand which certificate to use for which app so far (i may have to help him out by selecting the correct provisionning profile manually from time to time in the "project info" menu).
What i'm doing is to create a new certificate for every new "app store" account i'm working on, and of course never collide the app ids. That means my keychain is full of "iPhone developer - Ben (XDFUHSD)", "iPhone developer - Ben (DSUKJNSD)", etc... certificates, each beeing used for a different client.
Xcode does give me the error you mention from time to time, but it really only happens when one of my certificate has expired and i've just redownloaded a new one.
Hope this helps
For what it's worth, I got this error even though there was only one copy of the offending certificate in my keychain. The only odd thing about my setup was I'd added the keychain file from my 10.6 partition into Keychain Access, so I had two "login" keychains. Even though the other one didn't any certificates in it at all, the "appears more than once" error went away when I removed it from Keychain Access.
On the plus side, Automatic Provisioning seems to work pretty well these days, so clearing and reloading all my profiles wasn't the nightmare I'd thought it would be..

How do you solve the iPhone error "signature is valid but not trusted"?

Finally got MGTwitterEngine stuff to
compile (by setting the Header Search Paths to /usr/include/libxml2 iphoneos3.0/usr/lib/libxml2)
AND link (by removing the Twitter LibXML Parsers code and assigning a weak role to libxml2.2.dylib in Targets: Link Binary With Libraries).
But when I do a Build and Go to the iPhone (not the simulator), I get this error:
"This provisioning profile does not have a valid signature (or it has a valid, but untrusted signature)."
I have followed the official Apple Developer process of getting a certificate and provisioning, etc. Obviously, I did something wrong somewhere. Has anyone come across this problem or have any ideas on how to solve it?
Things to check:
In Keychain Access, make sure you have a code sign identity (public and private keys and a certificate titled "iPhone Developer: Your Name"
In your Info.plist, make sure your Bundle Identifier matches your App ID that you created in the dev portal
Make sure you installed the .mobileprovision (from Terminal> open x.mobileprovision)
In the dev portal, make sure your provisioning profile has your certificate, your App ID, and your device all enabled. If it doesn't, fix that and re-download and re-install your provisioning profile.
Follow the instructions very carefully when creating your Certificate. One time, in Keychain Access, when I went to Request a Certificate, I had something else selected in the list panel and so it created the wrong kind of certificate. Make sure nothing in the list is selected when you do this part.
Restarting Xcode may also work... (Work for me couple of times)
Troy It looks like the issue is you don't have a keypair that is tied to the provisioning profile installed. It's tough to tell for sure but that is my best guess.
If that is the case, I've been working in a similar situation - what you need is to either generate a private key using the iphone development portal under the same account your boss used and then add that new key to the provisioning profile you are building with.
OR
You can get your boss to export the key he generated when he created the provisioning profile - he can export it from keychain and give it a password that will allow you to install it but protect it from anyone else installing it.
I guess the fifth time's the charm. I basically deleted the certificate and the provisioning file, etc., and started completely over. Viola! Now for those pesky memory leaks! :-) Oh, Java, wherefore art thou, Java? (and your majic garbage collection!)
One of the things that I tried and worked for me was to reset the keychain access
http://support.apple.com/kb/TS1544