Xcode 4.1代码签名问题

13

我已经阅读了许多帖子,但没有找到类似我的问题。我认为这是一个简单的修复,但我似乎找不到答案。 我正在使用Xcode 4.1 Gold Master。

基本上,当我存档我的Mac应用程序时,它会经过所有正常的过程。编译成功。 但是,当我提交到应用商店时,我收到以下消息:

Invalid Code Signing Entitlements - Your application bundle's signature contains code 
signing entitlements that are not supported on Mac OS X; this may happen if your Mac OS X 
project was ported from iOS. Please check your Xcode project's code signing entitlements 
configuration, and remove any unneeded entitlements.

Specifically, key "application-identifier" in "My App" is not supported.

我的应用没有从iOS移植过来,我也从未设置过授权。经过长时间搜索,我发现代码签名阶段生成了一个.xcent文件,格式如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>My.App.Identifier</string>
    <key>com.apple.application-identifier</key>
    <string>My.App.Identifier</string>
</dict>
</plist>

问题出在第一个密钥。当我删除它并强制使用相同的 .xcent 文件通过命令行重新签名应用程序时,该应用程序就能成功运行。

我尝试移除并重新安装Xcode来解决问题......但没有效果。

我知道此文件创建与预配配置文件有关。它似乎获取了正确的数据,但添加了已存在的标记。我已经检查了项目和构建设置,没有任何代码签名权利。您有什么想法如何让 Xcode 停止生成此密钥吗?我不想每次提交到应用商店时都要这样做。

1个回答

13

我遇到了同样的问题。读完你的信息后,我进行了一些调查。

看起来,在构建过程中,.xcent文件是从位于/Developer/Platforms/MacOSX.platform/Entitlements.plist的文件生成的(它也可以位于/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Entitlements.plist)。

我编辑了此文件,并将“application-identifier”替换为“com.apple.application-identifier”。 因此,现在.xcent文件只包含:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.application-identifier</key>
    <string>33R9UFHX3C.com.mycompany.myapp</string>
</dict>
</plist>

然而,当我构建并上传它时,仍然遇到了无效二进制错误。

编辑:实际上它可以工作。 (我有另一个非相关问题)


下次构建时我会尝试这个!感谢您的建议。 - Scott Harwell
好发现!再次感谢你的帮助! - Scott Harwell

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接