title: Old provisioning profile keeps popping up
body: <p>I have an app that I have had on the AppStore for a while and I have updated it several times.</p>
  
  <p>After I installed my Mac from scratch without backing up my certificates (as I now know I should), I have been trying to set up the signing process again with no luck. I get the error:</p>
  
  <pre><code>CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 6.1'
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/dtOhw.png" alt="Code Signing"></p>
  
  <p>After a couple of attempts I have deleted all certificates in the KeyChain, deleted all provisioning files both in the organizer and on my phone and deleted everything on the provisioning portal.</p>
  
  <p>Then I let Xcode do everything. (XCode 4.6 installed today) It adds both developer and distribution certificates to my keychain and the development and distribution provisioning files to the organizer.</p>
  
  <p>But one strange thing happens. An old provisioning profile that I used on another project a couple of years ago keeps popping up. I wonder why and if it might disturb the signing process?</p>
  
  <p>Below is from the provisioning portal. The lower profile is the old one that keeps popping up. It has another appID. And it is strange that it says. "Managed by XCode" on only that one. I let Xcode do it all. And the date on it is the same as the profile I created today.</p>
  
  <p><img src="https://i.stack.imgur.com/tUWnc.png" alt="Provisioning portal"></p>
  
  <p>Can I get rid of this old one?
  Can it be that Xcode is confused and this is the reason?</p>