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

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?

Related

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.

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.

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

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

How do you fix this XCode error :
Code Sign error: The identity 'iPhone Developer' doesn't match any
valid certificate/private key pair in the default keychain
This happens if you forgot to change your build settings to Simulator. Unless you want to build to a device, in which case you should see the other answers.
I 'tripped' across my solution after 2 days...XCODE 4.0
I've just upgraded to XCode 4.0 and this code signing issue has been a stunning frustrastion. And I've been doing this for over a year various versions...so if you are having problems, you are not alone.
I have recertified, reprovisioned, drag and dropped, manually edit the project file, deleted PROVISIIONING paths, stopped/started XCODE, stopped started keychain, checked spelling, checked bundle ID's, check my birth certificate, the phase of the moon, and taught my dog morse code...none of it worked!!!!
--bottom line---
Goto Targets... Build Settings tab
Go to the Code Signing identity block
Check Debug AND Distribution have the same code signing information
..in my case "IPhone Distribution:, dont let DEBUG be blank or not filled in.
If the Debug mode was not the same, it failed the Distribution mode as well...go figure. Hope that helps someone...
Figure: This shows how to find the relevant settings in XCode 4.5.
Check if you are building for device instead of simulator. Go to Xcode menu 'Project' -> 'Set Active SDK' change from 'Device' to 'Simulator'
Under Xcode 4.1
Check your build settings for the project and your targets. For each check under 'Code Signing' check 'Code Signing Identity' and change over to 'Don't Code Sign'
I had the same problem. I'm very new to iphone development and it was my first time trying to load my program onto my iphone. The message is correct, you need to create a certificate in the keychain. The best walkthrough is here:
http://developer.apple.com/ios/manage/overview/index.action
You of course need to have a developer account (need to have paid the $100 yearly fee).
I hope this helps.
I had the same problem. I was very new to iPhone development and it was my first time trying to submit my app to App-store...
Check the following :
1. Check that your current "Bundle Identifier" is same as your current "Provisioning Profile" name in "Code Signing Identity".
2. In "Code Signing identity block" - Check Debug AND Distribution have the same "Code Signing Information". Try to keep the "Code Signing Information" same in all the Blocks.
3. Try to Download the "Provisioning Profile" again and double click on the profile. Then use that newly downloaded profile in your "Code Signing Identity".
4. Try to Download the "Certificate" again from the "developer.apple.com" and double click on the certificate. (It worked in my case)
Then "Clean" the project and click on "Build for Archive".
Hope your code will be archived perfectly.
This usually happens to me when I forget to change the company to match mine.
Select the target under Groups & Files
Click the Get Info button
Choose the Properties tab
Under Identifier, make sure it says com.YOURREALCOMPANYNAME.APPNAME
When you create a new app, it usually says, "com.yourcompany". Change it to whatever you registered with, in my case com.DavidKanarek
In XCode 4.0 main workspace, at the top left side & just after the "Stop Button", there is scheme selector, click on it and change your scheme to IPhone Simulator. That's it
When I had this problem, the issue was I did not have the private key necessary for the developer certificate to be valid.
The solution was:
Have the developer who created the certificate export their private
key matching the iOS developer public key. see
http://developer.apple.com/ios/manage/certificates/team/howto.action
Open this file (Certificates.p12) on your machine (with KeyChain),
and enter the password the other developer used when exporting. It
is now imported into your KeyChain.
Now connect iOS device and rebuild targeting the iOS device.
In my case, I didnt have the Apple Root certificate. It can be found here:
http://www.apple.com/certificateauthority/
if your certificate is not valid, it will have a red "x" and state the reason why. Generally the reason is "This certificate has expired" or "This certificate was signed by an unknown authority.
to solve this you need to do the following step.
If your certificate has expired, renew it at the iPhone Portal, download it, and double-click it to add it to your Keychain.
If it's "signed by an unknown authority", download the "Apple Worldwide Developer Relations" certificate from the Certificates section of the iPhone Developer portal and double-click it to add it to your Keychain.
If your certificate was revoked, delete the certificate from your Keychain, then follow the "Obtaining your iPhone Development Certificate" or "Obtaining your iPhone Distribution Certificate" section in the iPhone Developer Program Portal User Guide to generate a new certificate.
Make sure you create a backup of your private key. The steps for doing this are described in the iPhone Developer Program Portal User Guide, under "Saving your Private Key and Transferring to other Systems".
If you have the iPhone Developer (or iPhone Distribution) certificate and its associated private key, the Apple WWDR Intermediate certificate is installed, and your certificate is valid, confirm that Online Certificate Status Protocol (OCSP) and Certificate Revocation List (CRL) are set to "Off" in Keychain Access > Preferences > Certificates.
if you still getting problem then contact support apple community.
if you are just using the simulator and just upgraded then this solved the issue for me:
go to menu->project-edit project setting.
find code signing section (you can type 'code' in the quick search)
in the code signing identity select 'any sdk' and set the value to 'Don't Code Sign'
I just ran into this problem myself.
The fix I come out with was to go to the organizer, click on the "provisioning profiles" tab, and press refresh in the low corner.
You ll be asked to give your itunes connect password , just follow the instruction.
Hope it helps