I was working on my application and i started out with a really bad name. So i decided to change it. I did that like this.
At the top right corner i simply changed the name to what i want. and then i started getting the error as you can see there. Here are some more specific details.
Go to edit scheme as shown below.
then uncheck all other targets except your main target under build tab.