I cannot seem to be able to archive an app on a new computer. I created new provisioning profiles for distribution and development. I created a new Certificate Signing Req
A lot of people are copying the profiles manually from their "Provisioning Profiles" folder in "~/Library/MobileDevice" with success (including myself). If this works for you, quit copy+pasting and symlink it!
$ sudo -i
# mkdir /Library/MobileDevice; ln -s /Users/myuser/Library/MobileDevice/Provisioning\ Profiles/ /Library/MobileDevice/
-- where myuser is your username.
I did everything that everyone suggested, but none of these fixed my issue.
Using Xcode 7.3.1, what did fix it was this:
Change the settings to run the app on the simulator. If you have it set to run on a device, and the device udid isn't in the provisioning profile, it will (wrongly) yell at you.
Go to your Project > Target > Build settings > Code Signing > Provisioning profile and change it from "Automatic" to select the exact profile you want. At this point, if you haven't changed the app to run on a simulator, an alert might pop up yelling at you to "Fix Issue". DON'T do that!
After you manually select your provisioning profile from the list, archive your app. Viola!
I was getting the same error when i tried to archive, tried re-starting XCode, cleaning, rebuilding, nothing worked for a while. Then with the target selected as my project, under General -> Identity -> Bundle identifier, I just deleted and then re-typed the same exact (i know it's silly!) bundle identifier name and then tried to archive again, this time it worked. Such a crazy bug.
Most of you will face this issue in latest version of XCode i.e. 7.1, so the solution I used to solve this is
All Done.
I'm using XCode 7.2 and saw this problem. Restarting XCode solved this for me. Not sure it will always solve the problem, but you may want to try this first.
I updated Xcode7.1 to 7.1.1. Then, solved this problem.