So I'm trying to create an ad-hoc build using existing provisioning profile (that worked before) with Xcode 6.0.1 on Mavericks, but after trying to export this archive, I keep getting the following error:
Do I need to re-create my certificates and provisioning profiles, or is there a better solution? Thanks!
What's happening: Xcode need to sign build with valid Certificate. It is trying to locate one with no luck. Why? Because before Xcode6, you were allowed to sign AdHoc builds with your's developer certificate. And you were able to, because you have a private key for it. But now you need to sign Ad Hoc builds with Production Certificate. And you don't have a private key for it.
So steps required to make it possible to build from Xcode6 (https://stackoverflow.com/a/26061067/1918302):
Get a private key for your Production Certificate. (You need to export it from Mac keychain it has and import to your's keychain OR Revoke current and Create New production certificate. During creation you'll get one. Quoting here from link above:
Create special XC Ad Hoc: Distribution provisioning profile (if you have Admin role in your team on developer.apple.com - Xcode will do this for you).
Set provisioning profile in your project's target -> Build Settings -> Code Signing to this created in step 2.
Done!
OR if those above not achievable, you can make a build using command line tools: https://stackoverflow.com/a/25979784/1918302. But this seems to me as security hole and I don't believe that this will work for long time.
Try to open your console and go to your Xcode project folder then type these commands:
to clean your project
to build and archive your app
You can simply find YourSchemaName in Xcode > Product > Scheme > Edit Scheme...
finally to create your app .ipa file
To find Your Provisioning Profile Name please login to Apple Developer Member Center and go to Certificates, Identifiers & Profiles, then click on Provisioning Profiles for iOS Apps. There you will find Your Provisioning Profile Name.
If it does not work try to replace single quote with double one ( ' with " ).
You will find .ipa file in your Xcode project folder.
After this you will able to open your .ipa file in iTunes and install on your iOS device.
I hope it helps!
I was also receiving this error because the Developer Certificate for the machine I was building on had expired.
Even after renewing that certificate, I was unable to Export the Build for App Store release. Even after following the instructions in the accepted answer and upgrading that Developer account to an admin.
It turns out, that because the Archive was created while that Developer Certificate was expired, that Developer was unable to codesign using the Distribution Profile. I had to recreate the Archive, after renewing the Developer Certificate, for that machine to be allowed to use the Distribution Certificate (already installed and previously working) to be allowed to codesign the new archive and upload to app store.
Sharing in case anyone else hits this edge case.