Xcode 4.3:代码设计操作失败(检查您选择的身份是否有效)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9386925/
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 4.3: Codesign operation failed (Check that the identity you selected is valid)
提问by i4niac
After installing Xcode 4.3 I can't validate and distribute application using Organizer. While building, signing and validating in Xcode is OK, the validation in Organizer fails with the message in the title of this question.
安装 Xcode 4.3 后,我无法使用 Organizer 验证和分发应用程序。虽然在 Xcode 中构建、签名和验证没问题,但在 Organizer 中的验证失败,并显示此问题标题中的消息。
First, Xcode 4.3 can download provisioning profiles automatically (there's an option in Organizer), but it downloads only development profiles and ignores distribution profiles as if there are none. OK, I downloaded and installed it manually and it appears in Organizer. Then I set proper Code Signing Identity both for project and for target and use Distribution profile that matches Distribution certificate in my keychain. Then I do Archive (build-sign-verify) and no errors, in the log I see green checkmarks for CodeSign and for Verify steps. Looks good and the archive appears in Organizer.
首先,Xcode 4.3 可以自动下载配置文件(Organizer 中有一个选项),但它只下载开发配置文件并忽略分发配置文件,好像没有。好的,我手动下载并安装了它,它出现在管理器中。然后我为项目和目标设置正确的代码签名标识,并使用与我的钥匙串中的分发证书匹配的分发配置文件。然后我执行存档(构建签名验证)并且没有错误,在日志中我看到 CodeSign 和验证步骤的绿色复选标记。看起来不错,档案出现在管理器中。
And that's where all goes wrong, I just select Validate, choose the new version I just prepared in iTunes Connect, choose correct code signing identity, same as was used for Archiving (actually, there are no other choices in my case), it asks for iTunes login/password as usual, and then says
这就是一切都出错的地方,我只是选择验证,选择我刚刚在 iTunes Connect 中准备的新版本,选择正确的代码签名标识,与用于存档的相同(实际上,在我的情况下没有其他选择),它会询问像往常一样输入 iTunes 登录名/密码,然后说
Codesign operation failed
Check that the identity you selected is valid
代码操作失败
检查您选择的身份是否有效
Ahhh!!! Why!? It had no problems while archiving it, then same code signing doesn't work when trying to submit to AppStore. Well, not even submit, but validate before actually sending it. So this issue is local to my machine. The very same signing and validation that is successful during build, fails in Organizer...
啊啊!!!为什么!?存档时没有问题,然后在尝试提交到 AppStore 时相同的代码签名不起作用。好吧,甚至不提交,而是在实际发送之前进行验证。所以这个问题是我机器的本地问题。在构建过程中成功的相同签名和验证在管理器中失败......
I tried everything, re-installed Xcode, removed/revoked and re-issued all certificates, removed duplicated private and public keys from keychain, put all certificates in one "login" keychain, issued new profiles, installed Application Loader 2.5.1, and so on... still no luck.
我尝试了所有方法,重新安装 Xcode,删除/撤销并重新颁发所有证书,从钥匙串中删除重复的私钥和公钥,将所有证书放在一个“登录”钥匙串中,颁发新配置文件,安装 Application Loader 2.5.1,以及等等......仍然没有运气。
Could it be that I have some left-over from previous Xcode installs? Or that I have to update some tools to make Organizer work properly?
难道是我以前安装的 Xcode 留下了一些东西?或者我必须更新一些工具才能使 Organizer 正常工作?
Meanwhile, if anyone knows another way to upload binary to AppStore, please share. I couldn't figure out how to do that using Application Loader, when it asks me to choose a bundle to upload, all I have is xcode archive created by Xcode in Archive step. How do I get my hands on iap or whatever file the Application Loader wants from me?
同时,如果有人知道另一种将二进制文件上传到 AppStore 的方法,请分享。我无法弄清楚如何使用 Application Loader 来做到这一点,当它要求我选择要上传的包时,我所拥有的只是 Xcode 在 Archive 步骤中创建的 xcode 存档。我如何获得 iap 或 Application Loader 想要的任何文件?
回答by radven
I've discovered that Xcode 4.3.1 has a serious issue validating apps with resources within a directory tree within an application bundle.
我发现 Xcode 4.3.1 在使用应用程序包内的目录树中的资源验证应用程序时存在严重问题。
Apps can pass validation within the Xcode "Build for Archive" process - it only fails when the validation is run via Organizer.
应用程序可以在 Xcode“Build for Archive”过程中通过验证 - 只有在通过 Organizer 运行验证时才会失败。
After spending hours trying to trace down the usual code signing entitlement issues, I eventually noticed the following line in the system console when the export fails:
在花了几个小时试图追踪通常的代码签名权利问题之后,我最终在导出失败时注意到系统控制台中的以下行:
3/10/12 2:32:48.450 PM [0x0-0x261261].com.apple.dt.Xcode: /Users/chris/Library/Developer/Xcode/Archives/2012-03-10/Coverage 3-10-12 2.32 PM.xcarchive/Products/Applications/Coverage.app/Tiles/T-Mobile-roam/4: Is a directory
3/10/12 2:32:48.450 PM [0x0-0x261261].com.apple.dt.Xcode:/Users/chris/Library/Developer/Xcode/Archives/2012-03-10/Coverage 3-10-12 2.32 PM.xcarchive/Products/Applications/Coverage.app/Tiles/T-Mobile-roam/4:是目录
I spent a day trying to isolate this bug, and I've finally nailed it.
我花了一天的时间试图隔离这个错误,我终于把它搞定了。
The code signer in XCode 4.3.1 when validating for the App Store or saving for AdHoc distribution chokes whenever there is a subdirectory in your bundle that has the same name as its parent directory.
XCode 4.3.1 中的代码签名者在验证 App Store 或保存 AdHoc 分发时,只要包中存在与其父目录同名的子目录,就会阻塞。
For example:
例如:
test/test/file.x -- FAIL
test/test2/file.x -- WORKS
This seems to be new in Xcode 4.3.1, and hopefully will be fixed soon.
这似乎是 Xcode 4.3.1 中的新功能,希望很快会得到修复。
Notes: This thread seems related: https://devforums.apple.com/message/630800
注意:此线程似乎相关:https: //devforums.apple.com/message/630800
回答by jverdi
I was the original poster on the Apple Dev Forums...
https://devforums.apple.com/message/621193
我是 Apple Dev Forums 上的原始海报...
https://devforums.apple.com/message/621193
I've also attempted to bring this to the attention of the AddThis developers:
https://www.addthis.com/forum/viewtopic.php?f=19&t=38292
我还试图引起 AddThis 开发人员的注意:https://www.addthis.com/forum/viewtopic.php ?f =19&t =38292
As mentioned in the other posts, the only way I've found to prevent the code signing failure is to remove the ATResources.bundle file from the project.
正如其他帖子中提到的,我发现防止代码签名失败的唯一方法是从项目中删除 ATResources.bundle 文件。
Of course, this bundle contains many of the necessary images for AddThis, among other things, but the error no longer occurs.
当然,这个包包含许多 AddThis 所需的图像等,但错误不再发生。
I'm hoping this helps someone else discover the correct way to solve this issue.
我希望这可以帮助其他人找到解决此问题的正确方法。
回答by 3lvis
The problem is AddThis or explicitly the ATResources.bundle in the AddThis folder.
问题在于 AddThis 或 AddThis 文件夹中的 ATResources.bundle。
So you have two options:
所以你有两个选择:
The first one is using an older version of Xcode to Archive.
The second one is relocate all the images inside the ATResources.bundle into a folder, and copy the content of the Localizable.strings into your own Localizable.strings
Then open the FBDialog.m file and search for "close.png", remove that line of code and replace it with:
UIImage* closeImage = [UIImage imageNamed:@"close.png"];
第一个是使用旧版本的 Xcode 进行存档。
第二个是把ATResources.bundle里面的所有图片都重定位到一个文件夹中,把Localizable.strings的内容复制到自己的Localizable.strings中
然后打开 FBDialog.m 文件并搜索“close.png”,删除该行代码并将其替换为:
UIImage* closeImage = [UIImage imageNamed:@"close.png"];
Now you're ready to Archive.
现在您已准备好存档。
Finally consider to file a bug report in https://bugreport.apple.com/
最后考虑在https://bugreport.apple.com/提交错误报告
回答by Thomas Tempelmann
In my case, it was a damaged custom framework.
就我而言,它是一个损坏的自定义框架。
回答by bradjasper
I experienced this issue on Xcode 5.0.2 (5A3005) with 2 completely separate folders that happened to be named the same thing.
我在 Xcode 5.0.2 (5A3005) 上遇到了这个问题,其中 2 个完全独立的文件夹碰巧被命名为相同的东西。
Most other cases in this thread focus on the parent/sibling relationship, but I think it's any two folders with the same name will cause this failure.
该线程中的大多数其他情况都集中在父/兄弟关系上,但我认为任何两个具有相同名称的文件夹都会导致此失败。
回答by Nik
Just confirming that the problem was indeed nested folders with the same name in my app.
只是确认问题确实是我的应用程序中具有相同名称的嵌套文件夹。
In my particular case this was the issue:
在我的特殊情况下,这就是问题所在:
- problem: images/packs/1/1/img.png
- solution: images/packs/pack_1/1/img.png
- 问题:图像/包/ 1/1/img.png
- 解决方案:images/packs/ pack_1/1/img.png
Smooth sailing after that. This happened in Xcode 4.3.3
之后顺风顺水。这发生在 Xcode 4.3.3
回答by Harin
I had same problem in my project (in xcode 4.3.2) and as per all answers I checked for any .png
file starting with ._*
and also checked folder and its subfolder are different name.
我在我的项目(在 xcode 4.3.2 中)遇到了同样的问题,根据所有答案,我检查了以.png
开头的任何文件,._*
并检查了文件夹及其子文件夹的名称不同。
Also checked code signing identityas per requirement, but did not succeed to solve this problem.
还根据要求检查了代码签名身份,但没有成功解决这个问题。
After whole days effort finally I got reason for "Packaging operation failed" error in my project.
经过一整天的努力,我终于在我的项目中找到了“打包操作失败”错误的原因。
In my case, I have classed About_us.h
and About_us.m
and by mistake I import header file like #import "About Us.h"
(white space in middle). So when I loaded app on Device it will successfully loaded but when I try to create ipausing archive its give me error and return me Estimated App Store Size just 143 kb.
就我而言,我已经分类About_us.h
并About_us.m
错误地导入了头文件 #import "About Us.h"
(中间有空格)。因此,当我在设备上加载应用程序时,它将成功加载,但是当我尝试使用存档创建ipa 时,它给我错误并返回我估计的 App Store 大小仅为 143 kb。
Finally while I change header like #import "About_Us.h"
and try to make ipaI got real size in proper MB.
最后,当我更改标题 #import "About_Us.h"
并尝试制作ipa 时,我得到了正确的 MB 大小。
Hope this will help someone.
希望这会帮助某人。
回答by Neeraj Neeru
found the solution, it really works for me. hope this will help you guys.
找到了解决方案,它真的对我有用。希望这会帮助你们。
if the issue is because of Addthis, try following
如果问题是因为 Addthis,请尝试以下操作
noted that the inside ATResources.bundle you have a folder named ATResources.
注意到在 ATResources.bundle 里面你有一个名为 ATResources 的文件夹。
ATResources contains exactly the copy items (ADDTHIS.db,en.lproj,images) which is present in ATResources.bundle. so we can simply delete the ATResources folder from ATResources.bundle.
ATResources 完全包含 ATResources.bundle 中的副本项 (ADDTHIS.db,en.lproj,images)。所以我们可以简单地从 ATResources.bundle 中删除 ATResources 文件夹。
for deleting,, select the files from ATResources.bundle and right click , show in finder -> and remove ATResources folder.
要删除,请从 ATResources.bundle 中选择文件并右键单击 ,在 finder 中显示 -> 并删除 ATResources 文件夹。
the major issue is because subdirectory in your bundle that has the same name as its parent directory.
主要问题是因为包中的子目录与其父目录同名。
:)
:)
回答by Techi50
I have so many subdirectories on my bundle that have the same name as their parents, so I was not able to validate and submit. The only solution I found is to download xcode 4.2.1 from Apple developer center and install it side by side with xcode 4.3.2. Then I used it to validate and submit.
我的包中有很多子目录与它们的父目录同名,所以我无法验证和提交。我找到的唯一解决方案是从 Apple 开发人员中心下载 xcode 4.2.1 并将其与 xcode 4.3.2 并排安装。然后我用它来验证和提交。
回答by Diego Link
I'm developing on Sencha 2. The key here is to launch the System Console from Apps/Utilities and look at the error log when distributing. That's the easiest way to see the offending directory. In Sencha2 its in the /sdk/src/device/device. Good stuff: Still happening in xcode 4.3.2
我正在 Sencha 2 上开发。这里的关键是从 Apps/Utilities 启动系统控制台并在分发时查看错误日志。这是查看违规目录的最简单方法。在 Sencha2 中,它在 /sdk/src/device/device 中。好东西:仍在 xcode 4.3.2 中发生