Codesign error: Certificate identity appearing twice

前端 未结 15 2122
孤城傲影
孤城傲影 2020-12-07 13:04

CodeSign error: Certificate identity \'iPhone Developer: XXXX (12345678)\' appears more than once in the keychain. The codesign tool requires there only be one.

So I

相关标签:
15条回答
  • 2020-12-07 13:40

    If you are a member of the iOS Developer and Enterprise iOS Developer programs and you entered your company name in the same for both applications, you will end up with two valid distribution certificates with the same name.

    I believe this question addresses that situation: CodeSign collisions between Developer and Enterprise Distribution

    0 讨论(0)
  • 2020-12-07 13:40

    I was having trouble with zombie certificates being repopulated into my keychain and the certificate identity appearing twice. Simply deleting the duplicate cert did not work.

    In Xcode, when I looket at my Code Signing in the target, I remembered I had a different distribution profile in "Ad Hoc" builds than "Release" builds.

    When I generated a new certificate, I only downloaded a new profile for Ad Hoc builds, and not for Release builds.

    Xcode was hanging onto the certificate for both of those profiles, and Xcode was therefore causing the duplicate certificates... because I forgot to update my profiles properly.

    Make sure to update ALL your provisioning profiles to the new certificate, and change ALL the profiles at the same time in Xcode.

    Be sure to update all your provisioning profiles with the new certificate, otherwise Xcode will try to put the certificate for BOTH profiles in the keychain... causing the duplicate error!

    0 讨论(0)
  • 2020-12-07 13:42

    I just spent a fair amount of time struggling with this same issue. After all the attempts to fix it, I finally came to realize that it's a bug in Xcode. This post gave me a clue to fix it: certificates magically re appearing in your keychain

    In my case, the matching private key was in the System keychain, and just had my name on it (hard to tell it was for provisioning). I had to:

    • Move the associated private key to 'login' keychain
    • Restarted Xcode and noticed that the private key was now showing as associated (confirms what it was for)
    • Delete the cert and private key
    • Restart Xcode and poof! It stopped adding my old cert

    An interesting observation is that when you delete the certificate, it doesn't delete the associated private key. Visually, it shows the private key below the cert. Don't be fooled.

    Good luck!

    0 讨论(0)
提交回复
热议问题