Faced this issue, while trying to run an opensource project. I cloned it, but ran before changing the bundle ID, so it threw some error, then updated the ID and signed into my apple developer account (not with a membership), then I faced this Error.
The solution which worked for me, is to clean the build folder once and then running it again.