I had that problem and Xcode failed to compile on the device, but on simulator, it worked fine.
I solved with these steps:
- Open keychain access.
- Lock the ‘login’ keychain.
- Unlock it, enter your PC account password.
- Clean Project in the product menu.
- Build it Again.
And after that everything works fine.