Xcode - account already has valid iOS Distribution Certificate

Xcode / Preferences / Accounts - your apple id, is a member of the developer team? To the bottom right (of Accounts tab), under team name, it may default to "(your name) (Personal Team)", but there should also be another choice "(your team's name)". So if your team is named "The Awesome Team", then "The Awesome Team" should be selected under "Team Name", not your personal name.

UPDATE:
How to "select the team name" has varied from version to version of Xcode.
First step is to click on the team name.
Then click on a button below it. In one version, that button said "Show Details..". As I write this, the button says "Download all profiles".

Another alternative is to double-click the team name. This should pop up some dialog.

To verify that the desired team is still selected, you will have to quit Xcode, open it again, go to Preferences / Accounts again.

UPDATE #2:
In newer versions of Xcode, it seems that the real problem is "Automatically Manage Signing" isn't making the desired choice. Find that, and turn it off, then select the desired certificate. Sagar Mody's answer explains a bit more.


If still not working for you, but works for someone else, might be worth asking them for screenshots of what they see in (1) Member Center in browser - Certificates, Provisioning Profiles, (2) Xcode / Preferences / Account, (3) "View Details" for their account. Worst case, ask them to temporarily change their password, and try THEIR account on your computer, verify you can get everything working if you log in as them. If you can do that, then there is something not set up right for your account. Try to find a difference in Member Center, or in those Xcode screenshots.


The answer above by @toolmakersteve is technically right.

To achieve that what I did was, disabled "Automatically Manage Signing" then in Signing (Debug) / (Release) select "Eligible" bundle identifier.

From https://develop.apple.com/accounts download the Distribution Profile of XC: (Eligible bundle identifier). Double click on it install into Keychain Access.

Ensure in Xcode under "Signing Certificate" it shows "iPhone Distribution: (Organisation Name)" and not "iPhone Developer: (Your / Developer Name"

Now build and archive and the export worked successfully for me. Hope this solves the issue for you too. This was really frustrating.

Tags:

Ios

Xcode