Code Signing "No account for team" message when signing for different developer account

The solution for me was to set the team in General settings of the target and in General settings of the Tests.

enter image description here


For me the solution was to set the team in both General settings AND Build settings.

I'm using xcode 9.


In my case, the error was caused by obsolete team ID in the project settings. I.e. I got a project from a person long gone. So, I just copied the team ID from error message and used a search within the project in XCode to find where this team ID is. It found me two places in the project settings, I put a new developer id there and the error was gone.