title: Xcode 5: "No such provisioning profile was found ..." error
body: <p>I'm trying to distribute a new version of the app (it can be installed OTA) and I got the error:</p>
  
  <p><strong>"Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID “AdHocProfile”, however, no such provisioning profile was found.
  "</strong>
  and Xcode gets stuck in the process of automatically fix the error:
  <img src="https://i.stack.imgur.com/j4mrU.png" alt="automatic fix"></p>
  
  <p>I have spent a lot of hours in the weekend looking for a solution here and on the internet, only to get rid of one of the two errors I got when I tried to archive the app to distribute it "Ad Hoc".</p>
  
  <p>I made some capture screens to clarify what I've done:</p>
  
  <p><strong>Provisioning profile at Developer site:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/kL2gY.png" alt="member center"></p>
  
  <p><strong>My account: certificates and profiles:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/MqHyf.png" alt="certificates"></p>
  
  <p><strong>Project Settings:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/FWeCi.png" alt="project"></p>
  
  <p><strong>Target Settings (Xcode changed them when I deleted the line PROVISIONING_PROFILE in project.pbxproj):</strong> </p>
  
  <p><img src="https://i.stack.imgur.com/GtA4J.png" alt="target settings"></p>
  
  <p><strong>I deleted the line containing PROVISIONING_PROFILE in project.pbxproj, following the directions found in posts similar to <a href="https://stackoverflow.com/questions/8878812/provisioning-profile-not-found">this</a></strong> </p>
  
  <p><img src="https://i.stack.imgur.com/z8VgK.png" alt="project.pbxproj"></p>
  
  <p>I also removed both the stable and the beta versions of Xcode and reinstalled it from the App Store. Don't know if it's important, but I removed the beta 5.1.3 with App Cleaner, deleting all the files associated to it.</p>
  
  <p>Since Xcode does not longer show the values on the popup to choose certificates, I am not sure if I choose the correct ones.</p>
  
  <p>Could you please help me to solve this issue?</p>