Xcode 4.6.3 中 Dropbox API 的编码失败:“代码对象根本没有签名”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17263967/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:50:46  来源:igfitidea点击:

Codesign of Dropbox API fails in Xcode 4.6.3: "code object is not signed at all"

xcodemacosdropboxcode-signingmac-app-store

提问by Craig Otis

I have an OS X app that's distributed through the Mac App Store, and recently updated to Xcode 4.6.3.

我有一个通过 Mac App Store 分发的 OS X 应用程序,最近更新到 Xcode 4.6.3。

When I run my regular build now, I receive:

当我现在运行常规构建时,我收到:

Command /usr/bin/codesign failed with exit code 1:

/Users/Craig/Library/Developer/Xcode/DerivedData/Mac-dxcgahgplwpbjedqnembegifbowj/Build/Products/Debug/MyApp.app: code object is not signed at all
In subcomponent: /Users/Craig/Library/Developer/Xcode/DerivedData/Mac-dxcgahgplwpbjedqnembegifbowj/Build/Products/Debug/MyApp.app/Contents/Frameworks/DropboxOSX.framework
Command /usr/bin/codesign failed with exit code 1

I can't seem to discern any other changes in my project, so I can't tell if it's an issue related to the 4.6.3 update, or something else.

我似乎无法辨别我的项目中的任何其他更改,因此我无法判断这是与 4.6.3 更新相关的问题还是其他问题。

I have tried restarting Xcode, running a clean build, and cleaning the build folder.

我尝试重新启动 Xcode,运行干净的构建,并清理构建文件夹。

回答by Craig Otis

I think I may have figured this one out. I've been running Xcode 4.6.3 on OS X Mavericks, under the impression that any build-specific tools were bundled in the Xcode application.

我想我可能已经弄清楚了这一点。我一直在 OS X Mavericks 上运行 Xcode 4.6.3,给人的印象是任何特定于构建的工具都捆绑在 Xcode 应用程序中。

But, it seems codesignis in /usr/bin. Whether it's put there by one of the Xcode installers or comes with a vanilla system install, I'm not sure. But reading through the manpage for codesign, I found this nifty option:

但是,它似乎codesign/usr/bin. 我不确定它是由 Xcode 安装程序之一放置的,还是带有 vanilla 系统安装的,我不确定。但是通读了 的man页面codesign,我发现了这个漂亮的选项:

--deep  When signing a bundle, specifies that nested code content such as helpers, frameworks, and plug-ins, should be recursively signed
             in turn. Beware that all signing options you specify will apply, in turn, to such nested content.
             When verifying a bundle, specifies that any nested code content will be recursively verified as to its full content. By default,
             verification of nested content is limited to a shallow investigation that may not detect changes to the nested code.
             When displaying a signature, specifies that a list of directly nested code should be written to the display output. This lists only
             code directly nested within the subject; anything nested indirectly will require recursive application of the codesign command.

And then I found this post (https://alpha.app.net/isaiah/post/6774960) from two weeks ago (~June 2013), which mentions (albeit second-handedly):

然后我在两周前(~2013 年 6 月)找到了这篇文章(https://alpha.app.net/isaiah/post/6774960),其中提到(尽管是二手的):

@isaiah I asked a guy in the labs about it. He said codesign now requires embedded frameworks to be signed separately before code signing the app bundle as a whole.

@isaah 我问了实验室的一个人。他说 codesign 现在要求在对整个应用程序包进行代码签名之前,对嵌入式框架进行单独签名。

Manually re-running the codesigncommand that Xcode normally runs, while adding the --deepflag to the end, signs the application properly.

手动重新运行codesignXcode 正常运行的命令,同时--deep在末尾添加标志,正确签署应用程序。

I'm not yet sure exactly what ramifications this manual signing has, or whether I can tweak the Xcode build to add the --deepflag automatically, but this seems to be the underlying issue. (codesignno longer automatically deeply signs your app bundle.)

我还不确定这个手动签名到底有什么后果,或者我是否可以调整 Xcode 构建以--deep自动添加标志,但这似乎是潜在的问题。(codesign不再自动对您的应用程序包进行深度签名。)

回答by rougeExciter

As highlighted in other answers, there is a change to the way code signing works. If you've installed any of the Xcode 5 DP's then the new tools will be being used even if you are using Xcode 4.6.X.

正如其他答案中所强调的那样,代码签名的工作方式发生了变化。如果您安装了任何 Xcode 5 DP,那么即使您使用的是 Xcode 4.6.X,也会使用新工具。

All you need to do at this stage (in Xcode 4.6.X) is take the --deep flag suggested above and add it into your code signing flags (Target, Build Settings) see image below.

在此阶段(在 Xcode 4.6.X 中)您需要做的就是采用上面建议的 --deep 标志并将其添加到您的代码签名标志(目标、构建设置)中,见下图。

Specifying Deep Signing of Embedded Frameworks

指定嵌入式框架的深度签名

回答by andrei

For me, this problem was caused after dragging a folder named "resources" in my project. After changing its name into anything else(like "resourcessss" for example), the error disappeared.

对我来说,这个问题是在我的项目中拖动一个名为“resources”的文件夹后引起的。将其名称更改为其他任何名称(例如“resourcessss”)后,错误消失了。

回答by Maury Markowitz

I had the same problem, but the answer was simple: the code signing identity on my app was set to "-", so simply setting that to "Don't Code Sign" fixed me up.

我遇到了同样的问题,但答案很简单:我的应用程序上的代码签名身份设置为“-”,因此只需将其设置为“不要代码签名”即可解决问题。

"-" seems to be the default setting when you carry out some set of actions, although I can't tell you what those are.

“-”似乎是您执行某些操作时的默认设置,尽管我无法告诉您这些是什么。

回答by Thomas Ayoub

This might help somone:

这可能有助于某人:

I finally figured out the solution by trial and error. In my case I had a folder name that matched the “Product Name” variable under build settings. This also matched the entire project name! So I simply changed one field. I changed the “Build Settings” -> “Product Name” . The value of MySpecialApp was changed to My-SpecialApp. That was simply it! I then logged back into the Apple developer portal and created a new App ID and mobile provisioning profiles for development and distribution and the rest is history. My releases now work when deployed via the Ad Hoc distribution. A final note on this. This is definitely a bug that Apple should either alert the user that they have done something wrong and enable some sort of automated corrective action. - See more at: http://www.chrisdanielson.com/2012/08/29/codesign-ipa-and-the-code-object-is-not-signed-at-all-problem/#sthash.F0nF3BbC.dpuf

我终于通过反复试验找到了解决方案。在我的例子中,我有一个与构建设置下的“产品名称”变量匹配的文件夹名称。这也匹配了整个项目名称!所以我只是改变了一个领域。我更改了“构建设置”->“产品名称”。MySpecialApp 的值已更改为 My-SpecialApp。就是这样!然后我重新登录 Apple 开发人员门户并创建了一个新的 App ID 和移动配置文件,用于开发和分发,其余的都是历史。通过 Ad Hoc 发行版部署时,我的版本现在可以工作。关于这一点的最后说明。这绝对是一个错误,Apple 应该提醒用户他们做错了什么,并启用某种自动纠正措施。- 更多信息请访问:http://www.chrisdanielson.com/2012/08/29/codesign-ipa-and-the-code-object-is-not-signed-at-all-problem/#sthash.F0nF3BbC.dpuf

回答by UKDataGeek

For me it was a corrupted Framework PaddleMAs which: 1. I removed from my Cocoapods File 2. Ran pod install3. Restarted my Xcode

对我来说,这是一个损坏的框架 PaddleMAs,它: 1. 我从我的 Cocoapods 文件中删除了 2. Ran pod install3. 重新启动了我的 Xcode

and it solved the problem. For some reason a corrupted framework will prevent it being signed unfortunately XCode doesn't show this error really clearly and give you a good fix suggestion. Have raised a bug with Apple to fix.

它解决了这个问题。由于某种原因,损坏的框架会阻止它被签名,不幸的是 XCode 没有真正清楚地显示这个错误,并给你一个很好的修复建议。已向 Apple 提出了一个错误以进行修复。