首页 文章

XCode 6.1.1 无法编码:“代码对象根本没有签名”只有 1 个框架

提问于
浏览
2

我正在尝试使用 XCode 6.1.1 在 OSX 10.9.5 上使用 SDL 1.2 构建项目。

对 SDL_Mixer 1.2.12 和 SDL_Image 1.2.12 框架的副本进行的代码签名失败,因为它们包含 sub-frameworks。

所以我将这些 sub-frameworks 移出 SDL 框架,除了 webp.framework 之外,所有都可以签名,但不包含任何 sub-frameworks。

构建和错误消息是:

CodeSign /Users/manu/Library/Developer/Xcode/DerivedData/Tennis_Elbow_Manager-ejjxrszvggswuwbqutndhmguwbxc/Build/Products/Debug/Tennis\Elbow\Manager.app/Contents/Frameworks/webp.framework/Versions/A cd“/Users/manu/Documents/Workspace/Tennis Elbow Manager”导出 CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

签名身份:“Mac 开发者:”

/usr/bin/codesign --force --sign --preserve-metadata=identifier,权利,resource-rules /Users/manu/Library/Developer/Xcode/DerivedData/Tennis_Elbow_Manager-ejjxrszvggswuwbqutndhmguwbxc/Build/Products/Debug/Tennis\Elbow\Manager.app/Contents/Frameworks/webp.framework/Versions/A

.

/Users/manu/Library/Developer/Xcode/DerivedData/Tennis_Elbow_Manager-ejjxrszvggswuwbqutndhmguwbxc/Build/Products/Debug/Tennis 弯头 Manager.app/Contents/Frameworks/webp.framework/Versions/A:代码对象根本没有签名在子组件中:/Users/manu/Library/Developer/Xcode/DerivedData/Tennis_Elbow_Manager-ejjxrszvggswuwbqutndhmguwbxc/Build/Products/Debug/Tennis 弯头 Manager.app/Contents/Frameworks/webp.framework/Versions/A/webp 命令/usr/bin/codesign 失败,退出代码为 1

包含 webp.framework 的 SDL_image 框架可以从这里下载:https://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12.dmg

如果我从副本中删除 webp.framework,一切都正确构建,但然后我的应用程序无法启动,因为它无法链接到 webp。

我试图将 webp.framework 复制到工作区而不是引用它,但它没有改变任何东西。

提前感谢能够揭开这个神秘问题的人!

2 回答

  • 2

    好吧,我想我发现了什么是错的:info.plist 的可执行文件字段包含“FLAC”而不是“webp”,因此 webp 可能被视为应该自行签名的附加可执行文件。

    要在提交到 App Store 之前验证签名,还需要添加“Bundle identifier”字段(例如,使用“webp”)。

    我没有尝试解决这个问题,因为我已经转移到另一个解决方案:在没有 webp 支持的情况下重新编译 SDL_image。

  • 3

    我发现 self-signing 的另一个解决方案是 webp 和 SDL2_image 框架:

    • 导航到<FRAMEWORK_LOCATION>/SDL2_image.framework/Versions/A/Frameworks/webp.framework

    • 删除Versions文件夹(codesign 会抱怨捆绑包格式,否则)。

    • 执行codesign -f -s - webp

    • 导航到<FRAMEWORK_LOCATION>/SDL2_image.framework

    • 执行codesign -f -s - SDL2_image

相关问题