ios Xcode 8 显示配置文件不包含签名证书的错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39568005/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 8 shows error that provisioning profile doesn't include signing certificate
提问by Satish Mavani
Xcode 8 shows error that provisioning profile doesn't include signing certificate.
Xcode 8 显示配置文件不包含签名证书的错误。
This issue is with Xcode-8 only with Xcode 7, same provisioning profile showing related identified certificate.
此问题仅适用于 Xcode-8 和 Xcode 7,相同的配置文件显示相关的已识别证书。
采纳答案by Satish Mavani
回答by Eystein Bye
There are many ways to fix this, like enabling automatic signing etc. But if you want to understand the reason for this error you need to look at the error message.
有很多方法可以解决此问题,例如启用自动签名等。但是如果您想了解此错误的原因,则需要查看错误消息。
It says that the provisioning profile you have selected in the "General tab", does not contain the signing certificate you selected in the "Build settings" -> "Code Signing Identity".
它表示您在“常规选项卡”中选择的配置文件不包含您在“构建设置”->“代码签名身份”中选择的签名证书。
Usually this happens if a distribution certificate has been selected for the debug identity under "Build settings" -> "Code Signing Identity".
如果在“构建设置”->“代码签名身份”下为调试身份选择了分发证书,通常会发生这种情况。
If this happens under "Signing (Debug)" it might also be that the "Signing Identity" -> "iOS Development" is not included in the provisioning profile.
如果这种情况发生在“签名(调试)”下,也可能是“签名身份”->“iOS 开发”未包含在配置文件中。
回答by Nick
Check your keychain for identities that are missing a private key. I had multiple distribution certificates installed for the same team, one of which was missing the private key. Xcode was only checking the first matching identity in the keychain and automatically using this as opposed to the one that did include the private key.
检查您的钥匙串是否有缺少私钥的身份。我为同一个团队安装了多个分发证书,其中一个缺少私钥。Xcode 仅检查钥匙串中的第一个匹配身份并自动使用它,而不是包含私钥的身份。
Removing the matching identity that didn't have a private key made Xcode detect the correct identity again.
删除没有私钥的匹配身份使 Xcode 再次检测到正确的身份。
回答by d0ye
For those who should keep using not auotamatic for some reason
对于那些由于某种原因应该继续使用而不是自动的人
Open keyChain Access to see whether there are two same Certifications ,If there's two or more,Just Delete to one and it will work :)
打开keyChain Access查看是否有两个相同的认证,如果有两个或更多,只需删除一个就可以了:)
回答by Mussa Charles
I experienced this issue after recently updating Xcode to version 9.3 The issue was in code signing (under debug) certificate was set to distribution certificate instead of development certificate so this prevented me from installing the app on my devices.
我在最近将 Xcode 更新到 9.3 版后遇到了这个问题问题在于代码签名(在调试下)证书被设置为分发证书而不是开发证书,因此这阻止了我在我的设备上安装应用程序。
Here is what I did to solve this issue.
这是我为解决此问题所做的工作。
Project -> Targets -> Select your app -> Build Settings -> Code Signing Identity -> Debug -> Double tap "iPhone Distribution" and change it to "iPhone Developer".
项目 -> 目标 -> 选择您的应用 -> 构建设置 -> 代码签名标识 -> 调试 -> 双击“iPhone 分发”并将其更改为“iPhone 开发人员”。
回答by Loke
I unchecked and then checked the "Automatically manage signing" option. That fixed it for me.
我取消选中,然后选中“自动管理签名”选项。那为我修好了。
回答by blackHyman75
For what it's worth automatic signing failed every time until I just manually deleted local profiles in: ~/Library/MobileDevice/Provisioning Profiles
每次自动签名都失败了,直到我手动删除了以下位置的本地配置文件:~/Library/MobileDevice/Provisioning Profiles
After that automatic signing worked perfectly and it got the right profiles from Apple's servers.
在那之后自动签名工作得很好,它从苹果的服务器上得到了正确的配置文件。
This was affecting only some builds, notably the ones for which I had manually created profiles for watch app.
这仅影响了一些构建,特别是那些我为手表应用手动创建配置文件的构建。
回答by S.Go.Mot
For those who still struggle with this problem in Xcode8. For me was a duplicate Certificate problem, this is how I solved it:
对于那些仍然在 Xcode8 中遇到这个问题的人。对我来说是一个重复的证书问题,这就是我解决它的方法:
I read the answer of Nick and then I began my investigation. I checked all the keys and Certificates in my particular case (inside ~/Library/Keychains/System.keychain).
我阅读了尼克的回答,然后我开始了我的调查。我检查了我的特殊情况下的所有密钥和证书(在 ~/Library/Keychains/System.keychain 内)。
When I opened the file, I found that I had two iPhone Distribution Certificates (that was the certificate that Xcode was requesting me), one with the iOS Distribution private key that I have been using since the beginning, and another iPhone Distribution Certificate which its private Key had a name (iOS Distribution:NAME) that wasn′t familiar for me. I deleted this last certificate, started Xcode again and the problem was gone. xCode wasn′t able to resolve that conflict and that′s why it was giving signing certificate error all the time.
当我打开文件时,我发现我有两个 iPhone 分发证书(这是 Xcode 要求我的证书),一个是我从一开始就使用的 iOS 分发私钥,另一个是 iPhone 分发证书,它的私钥有一个我不熟悉的名字 (iOS Distribution:NAME)。我删除了最后一个证书,再次启动 Xcode,问题就解决了。xCode 无法解决这个冲突,这就是为什么它总是给出签名证书错误。
Check your keychains, maybe you have a duplicate certificate.
检查您的钥匙串,也许您有重复的证书。
回答by Mark
If you use manual signing (which I would definitely encourage), this error may occur because Xcode thinks that it should sign a release build with a developer certificate, which is obviously not included in a release provisioning profile.
如果您使用手动签名(我肯定会鼓励这样做),则可能会发生此错误,因为 Xcode 认为它应该使用开发人员证书对发布版本进行签名,而这显然不包含在发布配置文件中。
There is a build setting that defines which certificate should be used for which build configuration. To change it, go to build settings and search for Code Signing Identity. When expanded, there should be separate rows for each build configuration (usually Debug and Release) with in the second column its selected identity (usually iOS Developer or iOS Distribution). Make sure that it's set to the correct identity for each build configuration.
有一个构建设置,用于定义应将哪个证书用于哪个构建配置。要更改它,请转到构建设置并搜索Code Signing Identity。展开时,每个构建配置(通常是 Debug 和 Release)应该有单独的行,在第二列中选择其标识(通常是 iOS Developer 或 iOS Distribution)。确保为每个构建配置将其设置为正确的标识。
In some cases, the build configurations can also be expanded. Make sure that also its subitems are set to the correct identities.
在某些情况下,还可以扩展构建配置。确保其子项也设置为正确的身份。
回答by Tomek Cejner
You may also solve code signing issues with great Fastlane toolkit. Authors put a lot of effort to effectively automate building, signing iOS apps (and more).
您还可以使用出色的Fastlane 工具包解决代码签名问题。作者付出了很多努力来有效地自动化构建、签署 iOS 应用程序(等等)。
So in the mentioned suite, there is tool sigh
which magically resolves any signing issues, hence the name :) Nice thing here is, that this tool encapsulates a knowledge about common signing issues and can detect and resolve most of them.
因此,在提到的套件中,有一个工具sigh
可以神奇地解决任何签名问题,因此得名:) 不错的是,该工具封装了有关常见签名问题的知识,并且可以检测和解决其中的大部分问题。
Fastlane is installed as Ruby gem:
Fastlane 安装为 Ruby gem:
gem install fastlane
gem install fastlane
And then simply invoked:
然后简单地调用:
fastlane sigh --development
fastlane sigh --development
Answer two questions, and voila:
回答两个问题,瞧:
[11:56:55]: No existing profiles found, that match the certificates you have installed locally! Creating a new provisioning profile for you
[11:57:01]: Creating new provisioning profile for 'com.myapp' with name 'com.myapp Development'
[11:57:06]: Downloading provisioning profile...
[11:57:09]: Successfully downloaded provisioning profile...
[11:57:09]: Installing provisioning profile...
Finally, go to Build Settings -> Signing, and switch to newly created provisioning profile, whose name you just saw in the command output.
最后,转到Build Settings -> Signing,然后切换到新创建的配置文件,您刚刚在命令输出中看到了它的名称。
This example is for development code signing problem (running on the device). Check sigh documentationfor all other options.
此示例针对开发代码签名问题(在设备上运行)。查看所有其他选项的sigh 文档。