Code signing entitlement errors: Same error-differ

2019-09-02 03:04发布

问题:

I have an issue that is similar to this one. The solution doesn’t work for me and I suspect that it’s because Xcode and Apple have a different idea about what my Team ID is.

I get the same two entitlements errors as the cited post when validating my app. If I look at the Team ID in my Account profile on developer.apple.com, it says something like F65F8MK8HE. The iPhone Distribution certificate in my Keychain says, S88MMLNF5T.

The entitlement error says that the key value is not allowed and uses S88MMLNF5T.com.mydomain.myapp. If I open the archive and look for the file archived-entitlements-expanded.xcent it has two lines with the Team ID. If I replace the Team ID with the one on the website, the archive validates. That’s why I’m guessing the problem is that Xcode and the Apple site have different ideas about what the Team ID is. I’m guessing that I have to delete something to get them to synch up, but from past experience with deleting stuff, I’m hesitant to do anything without understanding what needs to be deleted.

I’m thinking that I should delete the iPhone Distribution certificate in my keychain and let Xcode regenerate what it needs? Does that sound reasonable?

Related to the issue, I can install apps on my devices and they all run. But all of the my old apps crash on launch. I suspect that it has something to do with the old apps using a different Team ID. So if I somehow get Xcode to use the new Team ID, will I be able to update apps in the store without them crashing?

This happens on Mavericks and Xcode 5.0 and 5.0.1.

回答1:

I asked Apple Developer Support this question and the response I got fixed my problem. It might work for others too.

Basically, there is a bug in Xcode that affects a few developers. The workaround is to make my signing section look like this.

Unlike the case that others have had, I did not choose the provisioning profile specific to the app but chose my distribution profile for release.



回答2:

If you're running an old project (3.1.5 or earlier) and migrating to XCode 5, you will have a manually created Distribution build target, which makes the Apple solution you're referring to impossible. In the answer I wrote to the question you're referring to I found a solution for that. (Leaving the links here for future visitors.)