eas local build failing for iOS due to distribution certificate

Managed Workflow
EAS-CLI: eas-cli/0.52.0 darwin-arm64 node-v16.13.0

eas build --profile preview --platform ios --local
#....
[RUN_EXPO_DOCTOR] Running "expo doctor"
[RUN_EXPO_DOCTOR] [12:27:03] πŸŽ‰ Didn't find any issues with the project!
[PREPARE_CREDENTIALS] Preparing credentials
[PREPARE_CREDENTIALS] Creating keychain
[PREPARE_CREDENTIALS] Preparing credentials for target 'TexasHoldEm'
[PREPARE_CREDENTIALS] Getting distribution certificate fingerprint
[PREPARE_CREDENTIALS] Writing distribution certificate to /var/folders/z8/ctrh1ssn4td1jflmz8q1jfn40000gn/T/81fa8f7a-dda3-4ac0-898b-aacd08caa3ae.p12
[PREPARE_CREDENTIALS] Importing distribution certificate into the keychain
[PREPARE_CREDENTIALS] Initializing provisioning profile
[PREPARE_CREDENTIALS] Validating whether distribution certificate has been imported successfully
[PREPARE_CREDENTIALS] Destroying keychain - /var/folders/z8/ctrh1ssn4td1jflmz8q1jfn40000gn/T/turtle-v2-63ec2d65-c725-45e5-8b06-fa91341c6340.keychain
[PREPARE_CREDENTIALS]
Error: Distribution certificate with fingerprint 4D2022CB36064B10AD16E0065F4D87BD95AEFDD6 hasn't been imported successfully for team ZHS89SP68Z
    at Keychain.ensureCertificateImported (/Users/adamgross/.npm/_npx/4303fabdaa4f873a/node_modules/@expo/build-tools/dist/ios/credentials/keychain.js:55:19)
    at async IosCredentialsManager.prepareTargetCredentials (/Users/adamgross/.npm/_npx/4303fabdaa4f873a/node_modules/@expo/build-tools/dist/ios/credentials/manager.js:100:13)
    at async IosCredentialsManager.prepare (/Users/adamgross/.npm/_npx/4303fabdaa4f873a/node_modules/@expo/build-tools/dist/ios/credentials/manager.js:58:41)
    at async /Users/adamgross/.npm/_npx/4303fabdaa4f873a/node_modules/@expo/build-tools/dist/builders/ios.js:26:20
    at async BuildContext.runBuildPhase (/Users/adamgross/.npm/_npx/4303fabdaa4f873a/node_modules/@expo/build-tools/dist/context.js:48:28)
    at async Object.iosBuilder (/Users/adamgross/.npm/_npx/4303fabdaa4f873a/node_modules/@expo/build-tools/dist/builders/ios.js:25:29)
    at async buildIosAsync (/Users/adamgross/.npm/_npx/4303fabdaa4f873a/node_modules/eas-cli-local-build-plugin/dist/ios.js:49:27)
    at async buildAsync (/Users/adamgross/.npm/_npx/4303fabdaa4f873a/node_modules/eas-cli-local-build-plugin/dist/build.js:28:32)
    at async main (/Users/adamgross/.npm/_npx/4303fabdaa4f873a/node_modules/eas-cli-local-build-plugin/dist/main.js:16:9)

Build failed
Distribution certificate with fingerprint 4D2022CB36064B10AD16E0065F4D87BD95AEFDD6 hasn't been imported successfully for team ZHS89SP68Z

However, that cert is in my keychain. However it’s in a custom keychain whatever that is.

image
image
image

Custom keychain screenshot from different run:

What I’ve tried:

I updated keychain.js to have a timer in between insertion and validation and updated the log message to print more info.

Minor changes here:

 async ensureCertificateImported(teamId, fingerprint) {
        const identities = await this.findIdentitiesByTeamId(teamId);
        if (!identities.includes(fingerprint)) {
            await new Promise(r => setTimeout(r, 100000));
            throw new Error(`Distribution certificate with fingerprint ${fingerprint} hasn't been imported successfully for team ${teamId}`);
        }
    }

You have to install the last Developer Relations Certificate
https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer

That works! Thank you!

How did you know that? I’m trying to learn and understand so I can be more self service in the future.

I googled it: https://developer.apple.com/forums/thread/662300

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.