You can import the developer profile into Xcode, the file of which has the extension .developerprofile , which was exported by Xcode. Xcode-> Preference-> Account â [SETTING ICON] â Export Accounts.
From xcode 6.x, export xcode ipa only with distribution certificate. Therefore, you must have a valid distribution certificate in the keychain.
If you install a developer certificate and try to export it,
if the distribution certificate is not created in the developer portal, then xcode will automatically create it.
if the distribution certificate has already been created by another mac, and you did not install it on your Mac, then Xcode will display the message "Your account already has a valid iOS distribution certificate" 
You can then either install the distribution certificate with a .p12 file exported using keychain from the old mac OR, or with the .developerprofile extension. xcode is exported from the old mac OR cancels the existing certificate and creates a new one and installs
Then remove the account from xcode and add it again. Then try building again.
Kiran patel
source share