title: Signing app in XCode: specified item could not be found in the keychain
body: <p>When archiving an app in XCode (Product > Archive) I get the following error:</p>
  
  <pre><code>CodeSign /Users/xxx/Library/Developer/Xcode/DerivedData/name-xxx/Build/Intermediates/ArchiveIntermediates/name/InstallationBuildProductsLocation/Applications/name.app
  cd /Users/xxx/Documents/name/App/platforms/ios
  export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
  export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
  
  Signing Identity:     "iPhone Developer: xxx xxx (S5L8942T98)"
  Provisioning Profile: "iOS Team Provisioning Profile: xxx"
                        (xxx)
  /usr/bin/codesign --force --sign xxx --entitlements /Users/xxx/Library/Developer/Xcode/DerivedData/name-xxx/Build/Intermediates/ArchiveIntermediates/name/IntermediateBuildFilesPath/name.build/Release-iphoneos/name.build/name.app.xcent --timestamp=none /Users/xxx/Library/Developer/Xcode/DerivedData/name-xxx/Build/Intermediates/ArchiveIntermediates/name/InstallationBuildProductsLocation/Applications/name.app
  
  error: The specified item could not be found in the keychain.
  </code></pre>
  
  <p>I revoked all my certificates and created new provisioning profiles, unfortunately it didn't help.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/16845169/error-when-trying-to-obtain-a-certificate-the-specified-item-could-not-be-found">this thread</a>, but I don't think it's related. Obviously something is missing in my keychain, but what?</p>
  
  <p><strong>Edit:</strong> </p>
  
  <p>This is a screenshot of my keychain: </p>
  
  <p><a href="https://i.stack.imgur.com/wjUXn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wjUXn.jpg" alt="enter image description here"></a></p>
  
  <p>The Id matches the one from the error code.</p>