Xcode 4.1 Code Signing Issue

跟風遠走 提交于 2019-12-09 14:40:45

问题


I've read through many threads and can't find anything like my issue here. I think that this is a simple fix, but I just can't seem to find the answer. I'm using Xcode 4.1 Gold Master.

Basically, when I archive my Mac app, it goes through all the normal processes. The build is successful. However, when I submit to the app store, I get the following message back:

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.

My app was not ported from iOS and I have never setup entitlements. After many hours of digging, I found that the code sign phase was generating an .xcent file in this format:

<?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>

The first key is the one causing the problem. When I remove that and force resign the app with the same .xcent file through the command line, then the app goes through.

I've removed and reinstalled xcode to see if that helps...it doesn't.

I know this file creation is tied to the provisioning profile. It seems to be getting the right data, but adding that existing tag. I've checked both the project and build settings and there are no code signing entitlements at all. Any idea how I can get Xcode to stop generating this key? I'm not really fond of doing this every time I want to submit to the app store.


回答1:


I face the same problem. After reading your message I investigated a little bit.

It looks like during the building process the .xcent file is generated from the file located at /Developer/Platforms/MacOSX.platform/Entitlements.plist (it may also be located in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Entitlements.plist).

I edited this file and replaced "application-identifier" by "com.apple.application-identifier". So now the .xcent file contains only:

<?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>

However I still face a invalid binary error when I build and upload it.

EDIT: it actually works. (I had another non-related issue)



来源:https://stackoverflow.com/questions/6680194/xcode-4-1-code-signing-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!