ios Xcode 尝试定位或生成匹配的签名资产,但未能成功
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25901269/
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 attempted to locate or generate matching signing assets and failed to do so
提问by liquidpenguins
So I'm trying to create an ad-hoc build using existing provisioning profile (that worked before) with Xcode 6.0.1 on Mavericks, but after trying to export this archive, I keep getting the following error:
因此,我尝试在 Mavericks 上使用 Xcode 6.0.1 使用现有的配置文件(以前工作过)创建临时构建,但在尝试导出此存档后,我不断收到以下错误:
Do I need to re-create my certificates and provisioning profiles, or is there a better solution? Thanks!
我需要重新创建我的证书和配置文件,还是有更好的解决方案?谢谢!
采纳答案by Tico Ballagas
I'm also facing this issue as a 'Team Member' role. The 'You are not allowed to perform this operation' warning leads me to believe that XCode is more strictly enforcing the roles defined here: https://developer.apple.com/programs/roles/
作为“团队成员”角色,我也面临着这个问题。“您不允许执行此操作”警告让我相信 XCode 更严格地执行此处定义的角色:https: //developer.apple.com/programs/roles/
Even though I have access to the signing assets (certificate and provisioning profile), XCode won't allow me to specify them. Try upgrading your role to Team Admin.
即使我可以访问签名资产(证书和配置文件),XCode 也不允许我指定它们。尝试将您的角色升级为团队管理员。
Updated 2014-09-29:After extensive research, I've found it is possible to generate the .ipa using xcodebuild from the command line even as a 'Team Member' role using the following:
2014 年 9 月 29 日更新:经过广泛研究,我发现可以使用 xcodebuild 从命令行生成 .ipa,即使作为“团队成员”角色也可以使用以下内容:
xcodebuild -exportArchive -archivePath $projectname.xcarchive -exportPath $projectname -exportFormat ipa -exportProvisioningProfile "Provisioning Profile Name"
credit to 1
归功于1
Note: As pointed out in the linked article, the "Provisioning Profile Name" is the name specified in the name field of the certificate (viewable from developer.apple.com).
注意:正如链接文章中所指出的,“配置文件名称”是证书名称字段中指定的名称(可从 developer.apple.com 查看)。
You can automate the process in xcode by including the call into your project build script.
您可以通过将调用包含到项目构建脚本中来自动化 xcode 中的过程。
回答by kammodze
Try to open your console and go to your Xcode project folder then type these commands:
尝试打开控制台并转到 Xcode 项目文件夹,然后键入以下命令:
to clean your project
清理你的项目
xcodebuild clean -project YourProjectName.xcodeproj -configuration Release -alltargets
to build and archive your app
构建和归档您的应用程序
xcodebuild archive -project YourProjectName.xcodeproj -scheme YourSchemaName -archivePath YourProjectName.xcarchive
You can simply find YourSchemaName in Xcode> Product> Scheme> Edit Scheme...
您可以简单地在Xcode> Product> Scheme> Edit Scheme... 中找到 YourSchemaName
finally to create your app .ipa file
最后创建您的应用程序 .ipa 文件
xcodebuild -exportArchive -archivePath YourProjectName.xcarchive -exportPath YourProjectName -exportFormat ipa -exportProvisioningProfile 'Your Provisioning Profile Name'
To find Your Provisioning Profile Nameplease login to Apple Developer Member Center and go to Certificates, Identifiers & Profiles, then click on Provisioning Profilesfor iOS Apps. There you will find Your Provisioning Profile Name.
要查找您的配置文件名称,请登录 Apple Developer Member Center 并转到Certificates, Identifiers & Profiles,然后单击Provisioning Profilesfor iOS Apps。在那里您会找到您的配置文件名称。
If it does not work try to replace single quote with double one ( ' with " ).
如果它不起作用,请尝试将单引号替换为双一( ' 与 " )。
You will find .ipa file in your Xcode project folder.
您将在 Xcode 项目文件夹中找到 .ipa 文件。
After this you will able to open your .ipa file in iTunes and install on your iOS device.
在此之后,您将能够在 iTunes 中打开您的 .ipa 文件并安装在您的 iOS 设备上。
I hope it helps!
我希望它有帮助!
回答by bucherland
What's happening: Xcode need to sign build with valid Certificate. It is trying to locate one with no luck. Why? Because before Xcode6, you were allowed to sign AdHoc builds with your's developer certificate. And you were able to, because you have a private key for it. But now you need to sign Ad Hoc builds with ProductionCertificate. And you don't have a private key for it.
发生了什么:Xcode 需要使用有效证书对构建进行签名。它试图找到一个没有运气的人。为什么?因为在 Xcode6 之前,您可以使用您的开发人员证书签署 AdHoc 构建。你能够做到,因为你有一个私钥。但是现在您需要使用生产证书签署 Ad Hoc 构建。而且你没有它的私钥。
So steps required to make it possible to build from Xcode6 (https://stackoverflow.com/a/26061067/1918302):
因此,使从 Xcode6 构建成为可能所需的步骤(https://stackoverflow.com/a/26061067/1918302):
Get a private key for your Production Certificate. (You need to export it from Mac keychain it has and import to your's keychain OR Revoke current and Create New production certificate. During creation you'll get one. Quoting here from link above:
BEWARE: revoking an enterprise distribution certificate invalidates all apps that were signed and deployed with that certificate (official info)).
Create special XC Ad Hoc: Distributionprovisioning profile (if you have Admin role in your team on developer.apple.com - Xcode will do this for you).
Set provisioning profile in your project's target -> Build Settings -> Code Signing to this created in step 2.
获取生产证书的私钥。(您需要从它拥有的 Mac 钥匙串导出它并导入到您的钥匙串或撤销当前并创建新的生产证书。在创建过程中你会得到一个。从上面的链接引用这里:
注意:撤销企业分发证书会使所有使用该证书签名和部署的应用程序失效(官方信息)。
创建特殊的 XC Ad Hoc: 分发配置文件(如果您在 developer.apple.com 上的团队中具有管理员角色 - Xcode 将为您执行此操作)。
在项目的目标 -> 构建设置 -> 代码签名中将配置文件设置为在第 2 步中创建的。
Done!
完毕!
OR if those above not achievable, you can make a build using command line tools: https://stackoverflow.com/a/25979784/1918302. But this seems to me as security hole and I don't believe that this will work for long time.
或者,如果以上无法实现,您可以使用命令行工具进行构建:https: //stackoverflow.com/a/25979784/1918302。但这在我看来是安全漏洞,我不相信这会持续很长时间。
回答by Clay Fowler
We were able to work around this problem by simply having one of the admins download the "XC Ad Hoc: Distribution" profile from the dev center, then sending it to the "Team Member" who wanted to build, and letting him manually import it. Since he already had the cert, this was all he needed to be able to do the build and stop getting this error. Existing answers here are correct, but this is a low-friction way to get the last piece of the puzzle for many of us.
我们能够通过简单地让其中一位管理员从开发中心下载“XC Ad Hoc: Distribution”配置文件,然后将其发送给想要构建的“团队成员”,并让他手动导入来解决此问题. 由于他已经拥有证书,这就是他能够进行构建并停止出现此错误所需的全部内容。这里现有的答案是正确的,但对于我们许多人来说,这是一种解决最后一块难题的低摩擦方式。
In summary, you need this profile andthe cert with a private key in your keychain.
总之,您需要此配置文件和钥匙串中带有私钥的证书。
回答by devios1
For me, it turned out the cause of this was I had not set the project's provisioning profile property as per this answer.
对我来说,结果是我没有按照这个答案设置项目的配置文件属性。
回答by Dima Deplov
I my case, the problem was App ID. Of course the app did exist in my member center account. The problem was in Capabilities pane. Some of the capabilities had not resolved issue, but the build was succesed. This lead to the situation, when my App ID in member center and Xcode have different capabilities settings.
我的情况是,问题是 App ID。当然,该应用程序确实存在于我的会员中心帐户中。问题出在功能窗格中。某些功能尚未解决问题,但构建已成功。这导致了这种情况,当我在会员中心的 App ID 和 Xcode 具有不同的功能设置时。
Removing this dissonance have resolved my problem. Check it twice, if you have simular issue.
消除这种不和谐解决了我的问题。如果您有类似的问题,请检查两次。
回答by user5684435
I was also receiving this error because the Developer Certificate for the machine I was building on had expired.
我也收到此错误,因为我正在构建的机器的开发人员证书已过期。
Even after renewing that certificate, I was unable to Export the Build for App Store release. Even after following the instructions in the accepted answer and upgrading that Developer account to an admin.
即使在更新该证书后,我也无法导出 App Store 版本的 Build。即使按照接受的答案中的说明并将该开发人员帐户升级为管理员。
It turns out, that because the Archive was created while that Developer Certificate was expired, that Developer was unable to codesign using the Distribution Profile. I had to recreate the Archive, after renewing the Developer Certificate, for that machine to be allowed to use the Distribution Certificate (already installed and previously working) to be allowed to codesign the new archive and upload to app store.
事实证明,因为存档是在开发人员证书过期时创建的,该开发人员无法使用分发配置文件进行协同设计。在更新开发人员证书后,我必须重新创建存档,以便允许该机器使用分发证书(已安装且以前工作)以允许对新存档进行协同设计并上传到应用程序商店。
Sharing in case anyone else hits this edge case.
共享以防其他人遇到此边缘情况。
回答by kingalex
Your distributed account is not match team .
您的分布式帐户不是匹配团队。
You must define your account in xcodeproj->Identity->Team ->Add an Account
您必须在 xcodeproj->Identity->Team->Add an Account 中定义您的帐户
回答by Eva Madrazo
You must define your account in Xcode->preferences->account It seems that you have define an appleId which is not allowed to access IOS developer account.
你必须在 Xcode->preferences->account 中定义你的帐户 看来你定义了一个不允许访问 IOS 开发者帐户的 appleId。
Try to sign with that user in https://developer.apple.com/devcenter/ios/index.actionand see if that user is allowed in an IOS developer program.
尝试在https://developer.apple.com/devcenter/ios/index.action 中与该用户签名,看看该用户是否被允许在 IOS 开发者程序中使用。
This can happens if you have signed with an iTunes connect. They are different accounts.
如果您已使用 iTunes 连接进行签名,则可能会发生这种情况。他们是不同的账户。
I hope this helps!
我希望这有帮助!