第一种解决方法:

I think I figured out why the simple delete is not working. Because the dev certificate is still stored in the provision profile, when I close/re-open the Xcode after deleting the certificate in Keychain, I saw the old certificate come back. So I delete it
again. It worked.

The simple delete the profile solution did not work for me.

Solution that worked in my case:

  1. Quit Xcode
  2. If the Keychain access is open, keep it open.
  3. Launch Xcode now.
  4. See that the certificate Xcode was complaining about will be re-added into the keychain at launch from its cache.
  5. Go ahead and delete it.
  6. Compile and happy coding.

第二种解决方法:

我解决了这个问题,自己来回答下吧:



原因是keychain access中存在过期的'iPhone Distribution: xxxx',但没有显示在钥匙链/登录中,而是在钥匙链/系统中,并且是隐藏的,因此需要在钥匙链->显示->显示过期证书,然后把钥匙链下的登录和系统的过期证书都删掉。



而且我在搜寻答案的时候,看到一篇帖子,有可能删除过期证书失败,但是在keychain里面却显示删除成功,这个问题的解决方法是重启keychain,删除,重复这个过程直到真正删除成功。



有时候在keychain里面找不到已过期、多余的证书,但我们在xcode的target的building setting的code signing里面却能够看到多余的证书,这个就证明我们的keychain并没有清楚干净。



总结下,解决这个问题的步骤是:1.清掉keychain里面多余的证书。2.刷新xcode里面的provisioning profile。



下面贴出官方的Troubleshooting:



This error indicates that while searching all keychains, Xcode found more than one signing certificate
for the same iOS developer program team member, and it does not know which one to use for code signing.



To resolve the problem, use the following process to ensure that there is only one copy of each certificate
type: "iPhone Developer" or "iPhone Distribution" within the entire keychain, for the same team member.



In Keychain Access, make sure your "View" menu > Show Expired Certificates option is turned ON

Click the "Certificates" 'Category' and then click through every one of the keychains you have listed in
your 'Keychain' sidebar in Keychain Access. If you see any duplicates, even expired certificates, delete those duplicates.

Click the "Keys" 'Category' in Keychain Access.

Navigate through every keychain looking for and deleting any "Orphaned Keys" that have the same Common
Name as the affected certificate. Orphaned keys are ones that are not bound by a Disclosure Triangle to an iPhone Developer or iPhone Distribution certificate that currently exists in the keychain.

If you found and removed any extra keys or certificates, please reattempt your build.

If the issue persists after removing all active or expired duplicate certificates or keys by the same common
name, you might try removing *all* existing signing certificates and keys and replace them with new ones using the steps in How do I delete/revoke my certificates and start over fresh?.

Finally, if the error persists even after creating new certificates, please control-click on the affected
certificate in Keychain Access, choose "New Identity Preference" and click the 'Certificate' field. If you see duplicate certificates listed in here, this is an known and uncommon issue with Keychain Access. To work around the problem, try the following:

Export your developer profile using the process in Transferring Your Identities.

Create a new OS X User Account, install Xcode for the new user and import the developer profile created
in the previous step. 

版权声明:本文为博主原创文章,未经博主允许不得转载。

Codesign error: Certificate identity appearing twice的更多相关文章

  1. How do I resolve the CodeSign error: CSSMERR_TP_NOT_TRUSTED?

    How do I resolve the CodeSign error: CSSMERR_TP_NOT_TRUSTED? The Xcode build error titled "CSSM ...

  2. centos6.9出现openvpn:error=certificate signature failure的处理

    原因: 将原来openwrt上用的证书复制到centos 6.9后,客户端都连不上了,查了服务器log,出现是error=certificate signature failure错误. 处理方法见帖 ...

  3. wget 无法建立ssl连接 [ERROR: certificate common name ?..ssl.fastly.net?.doesn?. match requested host name ?.ache.ruby-lang.org?. To connect to cache.ruby-lang.org insecurely, use ?.-no-check-certificate?]

    通过wget下载文件,报错 [root@Redmine-186 opt]# wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.g ...

  4. code.google.com certificate error: certificate is for www.google.com

    有时候我们会碰到下面错误:code.google.com certificate error: certificate is for www.google.com,类似如下: D:\>go ge ...

  5. node.js request请求url错误:证书已过期 Error: certificate has expired

    场景: node:8.9.3版本 报错代码: Error: certificate has expired at TLSSocket.<anonymous> (_tls_wrap.js:1 ...

  6. RDP Error: The Identity Of The Remote Computer Cannot Be Verified

    As i always need to remote to 20 servers at the same time, so i use a tool called Remote Desktop Con ...

  7. CodeSign error: code signing is required for product type Application in SDK iOS

    在真机测试的时候往往会突然出现这样一个错误,code signing is required for product type 'Application' in SDK 'iOS 7.0'  ,就是说 ...

  8. Iphone CodeSign error: no provisioning profile at path 错

    今天在退房手续,变化了profile,当再次进行整理编译项目时.就出现了这个问题,在xCode 6 开发环境下出现了, 出现这个错误提示Code Sign error: Provisioning pr ...

  9. [BEROR]CodeSign error: code signing is required for product type &#39;Application&#39; in SDK &#39;iOS 8.1&#39;

    解决方法: 选择project->Build Settings -> Code Signing -> Code Signing Identity -> Debug -> ...

随机推荐

  1. Hdu 1403(后缀数组)

    题目链接 Longest Common Substring Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  2. http请求生命周期流程

    https://mp.weixin.qq.com/s/fpA2CThk2L-YBw6z0k4rtw HTTP 请求/相应 1.客户端连接到Web服务器 一个HTTP客户端,通常是浏览器,与Web服务器 ...

  3. spring mvc 引入log4日记记录maven工程 slf4j和log4j输出到控制台配合使用log4j不输出到文件

    https://blog.csdn.net/qq_27093465/article/details/62928590 使用slf4j的优点: 提供带参数的日志输出方法(SLF4J 1.7及以后版本). ...

  4. c#的DateTime的各种字符串格式

    今天看到工程里有关DateTime的有关知识,之前了解一些用法,比如怎么获取年月日,当前系统时间等等,但是,感觉还是有好多不知道,于是上网搜罗了一下,找到很多有关知识,现在与大家分享下:     Da ...

  5. Leetcode566.Reshape the Matrix重塑矩阵

    在MATLAB中,有一个非常有用的函数 reshape,它可以将一个矩阵重塑为另一个大小不同的新矩阵,但保留其原始数据. 给出一个由二维数组表示的矩阵,以及两个正整数r和c,分别表示想要的重构的矩阵的 ...

  6. 卡特兰数(catalan)总结

    卡特兰数的公式 递推公式1:$f(n)=\sum \limits_{i=0}^{n-1}f(i)*f(n-i-1)$ 递推公式2:$f(n)=\frac{f(n-1)*(4*n-2)}{n+1}$ 组 ...

  7. Django基础内容整理

  8. LUOGU P2587 [ZJOI2008]泡泡堂

    传送门 解题思路 刚开始先写了个田忌赛马的贪心,就是要是打不过就拿最弱的送死,30分...后来瞄了眼题解,发现这样是错的,比如说这样的数据 : 3 3 2 3 1 如果用田忌赛马的话,让2-3 3-1 ...

  9. leetcode 21-30 easy

    21. Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list s ...

  10. Eclipse Git插件切换分支的时候不要Reset

    今天做了一件蠢事,我在当前分支上改了很多代码,后来切换分支的时候,有一个文件有冲突,eclipse提示这个文件冲突,我可以选择commit/stash/reset,我一看这个文件没什么关系,不需要提交 ...