As you all know, Apple changed how Xcode works such that you can\'t ever create an app with a previously used app ID, even if you\'re just writing test apps to use locally.
I had this and the other answers here didn't fix the problem. I solved it by opening Window > Devices, finding my device, right-clicking it to "Show Provisioning Profiles", and then deleting a bunch of the profiles there.
Then it worked!
Just use the bundle ID of any old app that you have already installed like this and change the bundle ID after 7 days. I think apple puts a limit for free developer accounts.
EDIT: Its important about what @haquangvu mentioned in his answer that, your old app get replaced. So take care of it and thanks @haquangvu for your answer.
Xcode>General>Identity
Copy Previous Bundle ID
Bundle Identifier : AppleDeveloperName-PreviousProjectName(or whatever)
Paste it in the new project's Bundle ID. It should be fine now.
Same thing happened to me. I presume it's some kind of a new limit that Apple has put on "non-paying" developers, and that it limits you to 10 apps in 7 days.
Edit - To resolve this, I'll just make a random apple dev ID...
Use one of your old Bundle IDs. It works. But your old Application will be delete.
DO NOT MAKE ANOTHER ID thats not the solution!!!
To make it work thats what you need to do:
Window > Preferences - Account
Then choose your apple ID and your team, then click on View Detail...
Button on the bottom right.
A new window will show up, click on Download all
button on the bottom left and all of yours Provisioning Profile will show up.
After that just Left click on those ones you don't have to use anymore and click to move to trash.
after you delete enough profiles, you'll be able to build your project again!