Neither restarting Xcode nor restarting my Mac helped.
Solution within Xcode:
- In Xcode, go to Preferences --> Accounts --> View Details
Press the + symbol and select iOS Development- Press the refresh button in the lower left corner (called
Download all
in Xcode 7)
PS:
- Sometimes it may also help to delete invalid provisioning profiles: right-click -> move to trash
- I saw this error exactly one year after signing up as an Apple developer.