Cannot validate uploaded Distribution Certificate

After included Apple Authentication to my app, I’m trying to build a standalone IOS app but it fails. I’m using my own credentials so I included the flags --dist-p12-path, --team-id and --provisioning-profile-path and I run the build clearing credentials.

:heavy_check_mark: App ID found on Apple Developer Portal.
:heavy_check_mark: Getting Distribution Certificates from Apple…
:heavy_multiplication_x: The Distribution Certificate is no longer valid on the Apple Developer Portal
Failed to set up Distribution Certificate
Failed to prepare all credentials.
The next time you build, we will automatically use the following configuration:

Project Credential Configuration:
Experience: @xxx/xxx, bundle identifier: xxx
Provisioning profile is missing. It will be generated during the next build
Apple Team ID: xxx, Apple Team Name: ---------

Cannot validate uploaded Distribution Certificate

expo diagnostics:
Expo CLI 3.20.5 environment info:
System:
OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 13.8.0 - ~/.nvm/versions/node/v13.8.0/bin/node
npm: 6.13.6 - ~/.nvm/versions/node/v13.8.0/bin/npm
npmPackages:
expo: ^36.0.0 => 36.0.2
react: 16.9.0 => 16.9.0
react-dom: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4
react-native-web: ^0.11.7 => 0.11.7
npmGlobalPackages:
expo-cli: 3.20.5

Same thing happening here.

I had the exact same issue.
Apparantly Expo is stearing away from manually adding your credentials. The way that solved it for me was by using expo credentials:manager and upload my credentials. Then trigger the build locally and point the build to the correct credentials through the interactive flow.
After this the automated CICD with the non-interactive flow would pickup the correct credentials and work perfectly.

If you want it to work by presenting your own credentials you will need to use Expo cli version 3.18.6, that worked for me as well.

Thanks for your answer, I’ve changed to Expo cli version 3.18.6 but it still doesn’t work.

Authenticating to Apple Developer Portal…
Authenticated with Apple Developer Portal successfully!
Only 1 team associated with your account, using Apple Team with ID: xxx
Fetching available credentials
:heavy_check_mark: App ID found on Apple Developer Portal.
**Failed to prepare all credentials. **
The next time you build, we will automatically use the following configuration:

Project Credential Configuration:
Experience: @xxx/xxx, bundle identifier: xxx
Provisioning profile is missing. It will be generated during the next build
Apple Team ID: xxx, Apple Team Name: ---------

Distribution Certificate - Certificate ID: -----
Apple Team ID: xxx, Apple Team Name: ---------
used by
@xxx/xxx (xxx)
Push Notifications Key - Key ID: xxx
Apple Team ID: xxx, Apple Team Name: ---------
used by
@xxx/xxx (xxx)

Then the build starts and fail with this message:
:heavy_multiplication_x: Build failed.
Standalone build failed!

In Expo logs I’ve found that the error is in Building and signing IPA section:

building and signing IPA
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at Function.from (buffer.js:313:9)
    at Object.writeBase64ToBinaryFile (/usr/local/turtle-js/build/builders/utils/file.js:8:27)
    at buildAndSignIPA (/usr/local/turtle-js/build/builders/ios/archive.js:48:21)
    at Object.buildArchive [as default] (/usr/local/turtle-js/build/builders/ios/archive.js:28:15)
    at async Object.iosBuilder [as ios] (/usr/local/turtle-js/build/builders/ios/index.js:29:13)
    at async build (/usr/local/turtle-js/build/jobManager.js:158:24)
    at async processJob (/usr/local/turtle-js/build/jobManager.js:103:32)
    at async Object.doJob (/usr/local/turtle-js/build/jobManager.js:35:5)
    at async main (/usr/local/turtle-js/build/server.js:44:13)

Can you show your full command?

expo build:ios --apple-id xxx --dist-p12-path xxx --team-id xxx --provisioning-profile-path xxx --push-p8-path xxx --push-id xxx -t archive --non-interactive

If you run this locally does it do the same thing?
and what if you remove the --non-interactive locally, does it work?

Otherwise I would really suggest to let expo credentials:manager handle the certs.

What do you mean by running locally? I tried without --non-interactive flag but it didn’t work.

I still have the same error, any solution? I could build an app version a few days ago when I delete the distribution certificate from another expo account, but now I have this error again

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