title: Why do I get "could not be added to your itunes library because it is not a valid app" error when trying to install Ad-Hoc build?
body: <p>I've recently upgraded my Mac to Lion, and also Xcode 4.</p>
  
  <p>In Build Settings, I've set "Code Signing" for "Release" to be "iPhone Distribution" which matches our Ad-Hoc provisioning file (which we've used in the past, on Snow Leopard/Xcode 3).</p>
  
  <p>I have deleted the old Entitlements file (as it's apparently no longer used by Xcode 4).</p>
  
  <p>In the Scheme section, I've set Archive to use the Release build.</p>
  
  <p>I'm building with Product > Archive.</p>
  
  <p>I'm saving the file by going into the Organiser and clicking Share, then making sure the same Ad-Hoc provisioning is selected.</p>
  
  <p>I'm sending the resulting IPA file to my boss, who has previously installed this app. When he tries to install it, he gets the message "[appname] could not be added to your itunes library because it is not a valid app".</p>
  
  <p>I've been trying every combination of settings I can think, but we just cannot get this to work. I can find this error only twice in Google - once from someone with a jailbroken phone and another posted in comments of an article, someone having the same issue, but there are no responses.</p>
  
  <p>Any help would be really appreciated.</p>
  
  <p><strong>Edit</strong>: Same thing happens trying to drag the IPA into iTunes on the Mac that created it! :(</p>
  
  <p><strong>Edit2</strong>: Just taken another (almost identical) project and tried a build without "Modernizing" the project, or selected any of the new options in Xcode (icons, launch images, orientation etc.), and this build works. I'm going to work through each of the things I did with the original app with this one, testing at each step. Hopefully should be able to isolate which step is breaking the compiled app!</p>
  
  <p>(also posted to <a href="https://devforums.apple.com/thread/124483" rel="noreferrer">Apple Dev Forums</a>)</p>