title: cannot archive app xcode 4,codesign error
body: <p>i recently uploaded my app to app store now i want to upload a new version of it.i upgraded to xcode 4, re downloaded  all the my developer and distribution certificate,and tried to archive the app for upload but it wont get archived giveing me codesign error</p>
  
  <pre><code>CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 5.0'
  </code></pre>
  
  <p>so i just deleted everything from my keychain access,xcode organizer and reinstalled everything from provisioning portal
  also it when i install the app to my iPad it installs but throws following warning</p>
  
  <pre><code>Application failed codesign verification.  The signature was invalid, or it was not signed with an iPhone Distribution Certificate. (-19011)
  </code></pre>
  
  <p>i checked all the links on StackOverflow but no luck</p>