title: The executable was signed with invalid entitlements 0xe8008016 - Distribution certificate
body: <p>I am getting error:</p>
  
  <pre><code>The executable was signed with invalid entitlements.
  The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016).
  </code></pre>
  
  <p>on <code>DISTRIBUTION CERTIFICATE &amp; PROVISIONING</code> Profile. Earlier, I was able to install the build using distribution profile, But, now I am not able to do so. It gives above error.</p>
  
  <p>Below is my entielement contents:</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;keychain-access-groups&lt;/key&gt;
  
  &lt;array&gt;
  
  &lt;string&gt;$(AppIdentifierPrefix)com.myapp.xyz&lt;/string&gt;
  
  &lt;/array&gt;
  
  &lt;/dict&gt;
  
  &lt;/plist&gt;
  </code></pre>
  
  <p>I have enabled <code>PushNotification</code> in my appid.</p>
  
  <p>From past 2-3 days, I have gone through many such post on stackoverflow and tried various solutions. But none of them has worked.
  Things I have done to resolve,</p>
  
  <ol>
  <li>Created a new cert and provisionf profiles </li>
  <li>Removed old certs from keychains and installed new ones</li>
  <li>Removed old provision profiles from system and installed new ones (Manully and automatically through <code>Xcode-&gt;Preferences-&gt;account-&gt;view Details-&gt; download all</code>)</li>
  <li><code>Restareted XCode</code> many times after removing certs adding new ones </li>
  <li>Clean and build project</li>
  <li>Cleared derived data</li>
  <li>Kept Provisioning profile on automatic (but it builds with developer provisioning profile, dont know why) </li>
  </ol>
  
  <p>According to error, I have matched my provision profile Application services (as per my appID in developer portal) with build capabilites in <code>XCode</code>. But its not working. 
  Does that <code>.entitlements</code> file has to do anything with "Build capabilites"? I tried removing <code>.entitlement</code>once but no luck. </p>
  
  <p>UPDATE:
  I created a new project, New appID (The default ones are enabled. In-app and game center) and new distribution provisioning profile. Still gives same error. :( </p>
  
  <p>UPADTE 2: Adding image of keychain<a href="https://i.stack.imgur.com/1arCn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1arCn.png" alt="enter image description here"></a></p>