title: Xamarin iOS app "does not contain the correct beta entitlement" despite the beta entitlement flag being part of the provisioning profile
body: <p>As the original TestFlight app will be retired in a month, I am trying to get to grips with the iTunes Connect Beta system, which looks like a significant improvement. As directed, I regenerated my provisioning profiles and redownloaded them on my build server.</p>
  
  <p>I then performed the build with the "AppStore|Release" profile and I saw this message in the log:</p>
  
  <blockquote>
    <p>codesign -v -f -s "XXXXXX" "--resource-rules=/.../MyApp.app/ResourceRules.plist" --entitlements "/../iSnagMobileiOS.xcent" "/../iSnagMobileiOS.app"</p>
  </blockquote>
  
  <p>The file specified in the entitlements parameter contained the beta-reports-active key as expected:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
      &lt;key&gt;get-task-allow&lt;/key&gt;
      &lt;false/&gt;
      &lt;key&gt;application-identifier&lt;/key&gt;
      &lt;string&gt;XXXXXXX.com.mycompany.myapp&lt;/string&gt;
      &lt;key&gt;com.apple.developer.team-identifier&lt;/key&gt;
      &lt;string&gt;XXXXXXXX&lt;/string&gt;
      &lt;key&gt;beta-reports-active&lt;/key&gt;
      &lt;true/&gt;
      &lt;key&gt;keychain-access-groups&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;XXXXX.com.mycompany.myapp&lt;/string&gt;
      &lt;/array&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>I then retrieved the generated IPA, which was signed with my distribution certificate. In order to check that the correct entitlement had been applied, I executed this command to check the provisioning profile:</p>
  
  <blockquote>
    <p>unzip -p MyApp.ipa Payload/MyApp.app/embedded.mobileprovision | security cms -D</p>
  </blockquote>
  
  <p>Within the XML fragment I could see the entitlements dictionary which contained the flag as expected:</p>
  
  <pre><code>&lt;key&gt;Entitlements&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;keychain-access-groups&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;XXXXXXXX.*&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;get-task-allow&lt;/key&gt;
      &lt;false/&gt;
      &lt;key&gt;application-identifier&lt;/key&gt;
      &lt;string&gt;XXXXXXXX.com.mycompany.myapp&lt;/string&gt;
      &lt;key&gt;com.apple.developer.team-identifier&lt;/key&gt;
      &lt;string&gt;XXXXXXXXX&lt;/string&gt;
      &lt;key&gt;beta-reports-active&lt;/key&gt;
      &lt;true/&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>There is also no extra Entitlements.plist file in the IPA that might be throwing this off. </p>
  
  <p>I uploaded the IPA with Application Loader 3.0, but I then received this error message:</p>
  
  <blockquote>
    <p>WARNING: ITMS-90191: "Missing beta entitlement. Your app does not include the beta-reports-active entitlement. If you intend to distribute this build via TestFlight for beta testing, please re-build this app with a newly generated provisioning profile."</p>
  </blockquote>
  
  <p>I have found numerous hits while searching for this message but none seemed to describe the above the problem; all those users found that regenerating the profile and downloading it again was all that was required.</p>
  
  <p>I wondered if I was perhaps experiencing an issue caused by an older version of XCode or MonoTouch but after I updated both, I still experienced the same problem. I'm going to guess that this issue is not caused by Xamarin but is perhaps caused by a setting I have overlooked in my build configuration, but I could be wrong there.</p>