Xcode 9: Provisioning profile is Xcode managed, but signing settings require a manually managed profile : <p>I need to archive my app for submission to iTunes Connect.</p>

<p>It was OK with Xcode 8.3.3:<br>
<a href="https://i.stack.imgur.com/rpB0D.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rpB0D.png" alt="enter image description here"></a></p>

<p>It's NOT OK with Xcode 9.0:<br>
<a href="https://i.stack.imgur.com/64ZeZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/64ZeZ.png" alt="enter image description here"></a></p>

<p>When archiving, I get:</p>

<blockquote>
  <p>Code Signing Error: Provisioning profile "XC iOS: *" is Xcode managed, but signing settings require a manually managed profile.<br>
  Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.0'</p>
</blockquote>

<p>The two screenshots are taken from the same computer, same workspace.
<a href="https://i.stack.imgur.com/J5rBo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/J5rBo.png" alt="enter image description here"></a></p>

<p>I can't use "Automatic" because it would change the provisioning profile to a different one, then after uploading to iTunes Connect I would get:</p>

<blockquote>
  <p><strong>Potential Loss of Keychain Access</strong> - The previous version of software has an application-identifier value of ['YBDK7H6MLG.com.ef.english24-7'] and the new version of software being submitted has an application-identifier of ['GEEM4BQ58H.com.ef.english24-7']. This will result in a loss of keychain access.</p>
</blockquote>

<p><strong>How do I make a release targeting iOS 11 without losing keychain access?</strong></p>
