I suddenly started receiving this error on my distribution builds:
Code Sign warning: Specified PROVISIONING_PROFILE (DBFBE0B4-B6DC-4AB7-909C-BE10988E0F7D) not found and no CODE_SIGN_IDENTITY specified. Ignoring PROVISIONING_PROFILE for now. This will become an error in the future.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.1'
This error only occurs when I try to build for distribution. AdHoc compiles and runs fine. I suspected an expiry or something, but no such luck. I checked the build settings and they have a selected signing and provisioning cert for the AppStore build. And the selected profiles appear to be correct:
This turned out to be an extremely obscure problem with my Mac, not Xcode. Due to problems while migrating from one machine to another, the security settings on the Library folder gained a new Permission, "Custom". This did not allow access to some of the files within, critically a plist that keychain uses to figure out where your user keychain is stored. Once the permissions on that file were fixed, Xcode was able to download the certs and off I went.