After fastlane match can't find signing identity


#1

There’s a step to run fastlane match in my Fastfile, in order to download the certificate and provisioning profile.

The build fails here. Apparently it succeeds downloading the certificate, but then says it doesn’t find a signing identity:

[07:43:27]: Cloning remote git repo...
[07:43:27]: 🔓  Successfully decrypted certificates repo
[07:43:27]: Verifying that the certificate and profile are still valid on the Dev Portal...
[07:43:29]: Installing certificate...
[07:43:29]: There are no local code signing identities found. You can run `security find-identity -v -p codesigning` to get this output. This Stack Overflow thread has more information: http://stackoverflow.com/q/35390072/774. (Check in Keychain Access for an expired WWDR certificate: http://stackoverflow.com/a/35409835/774 has more info.)
[07:43:30]: Installing provisioning profile...

I tried debugging with ssh - ran fastlane match from the console, and this succeeded!

[07:51:18]: 🔓  Successfully decrypted certificates repo
[07:51:18]: Verifying that the certificate and profile are still valid on the Dev Portal...
[07:51:20]: Installing certificate...
[07:51:21]: Installing provisioning profile...
(...)
[07:51:21]: All required keys, certificates and provisioning profiles are installed 🙌

Why is this? Don’t find anything useful in the stack overflow posts mentioned in the error. Also what I don’t understand is why it works in the console (in the same container) and not during the build.

This is my circle.yml:

machine:
  xcode:
    version: 8.0

dependencies:
  pre:
    - security unlock-keychain -p circle ${HOME}/Library/Keychains/circle.keychain

  override:
    - bundle install:
        timeout: 240

deployment:
  mybeta:
    branch: [circletest]
    commands:
      - bundle exec fastlane beta

test:
  override:
    - echo ""
     

#2