I had the same error message when I was trying to build an app on my iPhone. Everything seemed to be in order, I.e. the certificates were all valid and present and so on, but I just couldn't get it to work.
I just couldn't find the option "iOS team provisioning profile" in Project > Build Settings > Code Signing > Code Signing Identity - this was the main clue to a solution. If you can't see that option there, check your Xcode Organizer.
Inside it, go to Library > Provisioning Profiles:
Now what you should see if everything were right is this:
But if on the other hand you see an empty list, click the Refresh button in the lower right corner of the Organizer:
After said procedure, Xcode started churning out wonderful messages of "adding" and "finishing" and then my app appeared on my iPhone. The End.
Good luck!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…