Xcode 4.6.3中Dropbox API的协同设置失败:"代码对象根本没有签名"

Cra*_*tis 75 macos xcode code-signing dropbox mac-app-store

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

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

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
Run Code Online (Sandbox Code Playgroud)

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

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

Cra*_*tis 140

我想我可能已经想到了这个.我一直在OS X Mavericks上运行Xcode 4.6.3,其印象是任何特定于构建的工具都捆绑在Xcode应用程序中.

但是,似乎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.
Run Code Online (Sandbox Code Playgroud)

然后我在两周前(〜2013年6月)发现了这篇文章(https://alpha.app.net/isaiah/post/6774960),其中提到了(虽然是第二手):

@isaiah我问过实验室里的一个人.他说,在签署应用程序包整体代码之前,codesign现在要求单独签署嵌入式框架.

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

我还不确定这个手动签名到底有什么影响,或者我是否可以调整Xcode构建以--deep自动添加标志,但这似乎是潜在的问题.(codesign不再自动深入签署您的应用包.)

  • 是的 - 我能够在我的Xcode项目的Build Settings中找到"Other Code Signing Flags"选项,添加`--deep`,现在构建成功.我们将看看这是否通过Mac App Store. (39认同)
  • 对于好奇的人,我已经在10.8上使用Xcode 5了很长一段时间,但是当我尝试在10.9下签名时,今天只遇到了这个问题. (3认同)
  • Craig Hockenberry(以下答案中的链接)解释了为什么使用deep是错误的 (2认同)
  • 2017年底 - 仍然有效._谢谢!_ (2认同)

rou*_*ter 67

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

在这个阶段你需要做的就是(在Xcode 4.6.X中)采用上面建议的--deep标志并将其添加到你的代码签名标志(Target,Build Settings)中,见下图.

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

  • 帮助过我.我想这意味着你以某种方式担保你使用的所有导入的库. (3认同)
  • Apple TechNote 2206声明"虽然--deep选项可以应用于签名操作,但不建议这样做.我们建议您在各个阶段内部签署代码(因为Xcode会自动执行).使用--deep签名是为了紧急仅修理和临时调整." (3认同)
  • 这完全是诀窍.救了我的一天,谢谢! (2认同)

and*_*rei 12

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