codesign failed with exit code 1
<p>I'm trying to submit my first app to the app store. When I compile (configuration set as 'Distribution') I get the error below:</p>

<blockquote>
  <p>CodeSign
  build/Distribution-iphoneos/xxxxx.app
  cd /Users/xxxxxxx/Documents/xxxxxx
  setenv
  IGNORE_CODESIGN_ALLOCATE_RADAR_7181968
  /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
  setenv PATH
  "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
  /usr/bin/codesign -f -s "iPhone
  Distribution: XXXXXXXXXX"
  --resource-rules=/Users/xxxxxxxx/Documents/Legginit/build/Distribution-iphoneos/xxxxxxx.app/Entitlements.plist
  --entitlements /Users/xxxxxxxx/Documents/xxxxxxx/build/xxxxxx.build/Distribution-iphoneos/xxxxxxx.build/xxxxxx.xcent
  /Users/xxxxxxx/Documents/xxxxxx/build/Distribution-iphoneos/xxxxxxx.app</p>
  
  <p>/Users/xxxxxxx/Documents/xxxxxx/build/Distribution-iphoneos/xxxxxx.app:
  invalid resource selection rule(s)
  Command /usr/bin/codesign failed with
  exit code 1</p>
</blockquote>

<p>I've double checked the following:</p>

<p>1) Code Signing Identity is set to 'Any iPhone OS Device' and on the right hand side my Distrbution certificate.</p>

<p>2) I've created Entitlements.plist unchecked get-task-allow.</p>

<p>3) Bundle Identifier matches my Distribution Provisioning Profile.</p>

<p>4) Keychain Access has two certificates, 'iPhone Developer' and 'iPhone Distribution'. </p>

<p>There are plenty of threads with people receiving this error, but I've been looking at them all morning and I don't see anything different from what I have done.</p>

<p>Any help is very much appreciated.</p>

<p>Stephen</p>
