When i got this error I checked in my organizer window and found a duplicate identity in my nameI tried to delete the duplicate identity in my organizer window. But i am not able to select or delete it.Please help me to delete this duplicate identity.
11 Answers
Your certificate is stored in your keychain. Just open up the keychain and look for a duplicate and then restart XCode.

- 1,026
- 1
- 11
- 35

- 5,090
- 28
- 26
-
41As noted in the other answer, make sure you restart Xcode! – deleting the duplicate from Keychain Access won’t do anything otherwise. – DouglasHeriot Feb 18 '12 at 13:41
I encountered a problem where the old certificate keep reappearing even I delete it on KeyChain Access. The solution is to delete all provisioning profiles that use the old certificate from XCode organizer.

- 277
- 3
- 5
-
same for me but also had 2 dev profiles under my account. had to revoke one, delete both profiles then do a refresh like they do here http://stackoverflow.com/a/8509545/530933 – owen gerig Jun 12 '13 at 17:28
Open up Keychain Access. Under Category on the lower left side of the pane you should select "My Certificates" In the main pane you'll see the duplicate certificate. If one is invalid, it will have a red X on it as well. Delete it, restart Xcode, and you're good to go.

- 13,349
- 11
- 66
- 105
In the "Keychain Access" program, under the "View" menu, select "Show Expired Certificates" (if the menu item says "Hide Expired Certificates", then you're already showing them). Then, check each keychain in the list on the left for a duplicate certificate. Also, for each keychain, be sure to look under both “Certificates” and “My certificates” (if present).

- 1,625
- 1
- 16
- 20
Xcode 4.3 now searches all keychains for signing certificates but that is increasing the frequency of the build error:
Certificate identity (x) appears more than once in the keychain...
Apple's steps to resolve it are here: "How do I resolve the CodeSign error: Certificate identity appears more than once in the keychain?"
However, if you are affected by the keychain bug mentioned in the final note of that guide, following is a simpler and preferred solution to problem:
1) Keychain Access > Edit > Keychain List, uncheck "Shared" for the login keychain.
2) next, IF going back into the Keychain List you find the login keychain is still marked as Shared, create a backup of the following files and then remove them if they exist:
/Library/Preferences/com.apple.security-common.plist
~/Library/Preferences/com.apple.security.plist
3) Retry your build.

- 4,040
- 1
- 29
- 29
My case, I tried to take a look at only login keychains no success. When I opened System keychains I found there was old (expired) certificate and it was duplicated. After deleted the duplicated certificate, everything worked fine.

- 1,104
- 3
- 17
- 31
After upgrading to XCode 4.3 I had this exact issue. The build process kept failing and in KeyChain Access I was sure I only had one development certificate. There wasn't much help on the net either on how to solve it but I managed to get around it with the following method. Please note that I don't know if this will work on older version of Xcode but the best thing is to just let Xcode take care of the entire process.
First thing is to check if you do indeed have duplicates certificates.
Open Terminal and enter this command:
sudo /usr/bin/security find-certificate -a -Z -c "iPhone Developer" | grep SHA-1
If you see multiple of the same SHA-1 hashes then you do have duplicates and we need to remove them.
In KeyChain Access (I haven't verified this but this step may not be necessary):
- Create a new KeyChain - I called mine login-new
- Select the new keychain in the Keychains pane.
- Go File->Make keychain "login-new" default
In XCode Organizer:
- In the Devices pane, delete all your provisioning profiles
In the developer provisioning portal:
- Revoke your Development and Distribution certificates
Back to XCode Organizer:
- You should have a blank list of provisioning profiles
- Hit the Refresh button
- XCode will prompt you to login to your developer account, it will then ask you if you want to generate both development and distribution certificates because it cannot find any.
- Continue and generate them.
Go back to Terminal and re-enter the find-certificate command from above. You shouldn't at this point see any duplicates.
Next step is to fix your provisioning profiles. So go to the provisioning portal and modify each profile. Head back on over to Xcode organizer and hit the refresh button.
Once the profiles appear you will need to re-associate the Code Signing Identities within your Build Settings to make sure you don't get a code signing error.
Your app should now build and run on your device.

- 7,282
- 8
- 50
- 47
-
I'm having this problem and thought for certain this would fix it. But I get to the step where no duplicates should appear, but they're still there. I have no idea how to get rid of them. – Jason Apr 29 '12 at 02:11
-
I had to manually delete the certificates with 'delete-certificate'. Despite that and following these instructions, a duplicate was still there! But this time it showed up in the Keychain and deleted it successfully. What a huge waste of time. Thanks for the help! – Jason Apr 29 '12 at 02:43
-
Yeah, sometimes you need to be persistent when it comes to certificates and just keep deleting with different methods until they go away. – Michael Gaylord Apr 30 '12 at 09:50
-
For me, this method did not find duplicate certificates that were in 'Certificates' and 'My Certificates' as noted by DataGraham and RickJansen below, so make sure to check that manually. – MaxGabriel Oct 29 '12 at 18:11
Had the same issue, but deleting the expired certificate was to no avail, it popped up again the moment Xcode started up!
In Keychain Access, in the leftmost pane, under Category there is "My Certificates", but also another entry: "Certificates". I had deleted the certificate from "My Certificates", but had not looked under "Certificates". Deleting the (expired) certificate from "Certificates" too solved it for me.

- 1,615
- 18
- 24
If things still aren't working for you after removing the offending certificate, try doing a Product > Clean
. In my case, that was necessary even after a system restart.

- 39,603
- 20
- 94
- 123

- 4,912
- 6
- 34
- 44
I keep getting this error, even after I removed the duplicate. Finally I did the following:
- open up Keychain Access and remove the duplicate certificate (just keep
the latest one ) from
My Certificates
&Certificates
section - Go to keys and check for the private key resides there without public key, if yes, remove it.
- Then restart Xcode.
This fixes my issue.

- 5,405
- 8
- 44
- 82

- 621
- 6
- 10
in my case a hidden expired cert was the duplicate. Above hints proved helpful !

- 1,381
- 10
- 14