I am trying to run a Swift app on my iPhone 4s. It works fine on the simulator, and my friend can successfully run it on his iPhone 4s. I have iOS 8 and the official release
OK, sharing here another cause of this error. It took me a few hours to sort this out.
In my case the trust policy of my certificate in Keychain Access was Always Trust, changing it back to defaults solved the problem.
In order to open the certificate settings window double click the certificate in the Keychain Access list of certificates.