>I have a developer account.
Which type? free, paid?
>clean / build.
A simple clean is rarely effective. With the option key pressed, use the Product menu and choose to 'clean build folder', instead.
Seen this SO thread?
https://stackoverflow.com/questions/29242485/command-usr-bin-codesign-failed-with-exit-code-1-code-sign-error
Remember, you can't archive if:
- a simulator is selected instead of a device*
- there is an error when building*
-you haven't finished the 'Prepare for Submission’ stage for that app in iTunes Connect
- See: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/ChangingAppStatus.html
- you've recently renewed your (required) apple developer account, and not yet updated the provisions to reflect that activity
* You must have at least one device registered in the Member Center, but it doesn’t have to be connected to your Mac/Xcode when building, in which case select ‘generic iOS/tvOS device'
- - - If this is just about testing to a device and you're getting a message that Xcode can't archive, try deleting all older versions of that app on the target device first