Cannot reuse Apple Distribution Certificate

Every time I want to reuse the Apple Distribution Certificate, the console show me the error message.

Error: validateProvisioningProfile: provisioning profile is not associated with uploaded distribution certificate
    at _ensureDeveloperCertificateIsValid (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosCodeSigning.js:187:11)
    at Object.validateProvisioningProfile (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosCodeSigning.js:176:3)
    at Object.build (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosIPABuilder.js:131:24)
    at <anonymous>

reproduce steps:

  1. build iOS app A with command expo build:ios -c and clear all credentials
  2. expo create new provision profile, distribution certificate and push notification key for me.
  3. build another iOS app B with command expo build:ios (different bundle id)
  4. choose reuse distribution certificate and push notification key like the following messages
? How would you like to upload your credentials? Expo handles all
 credentials, you can still provide overrides
? Will you provide your own Apple Distribution Certificate? Let Expo handle the process
? Would you like to reuse Apple Distribution Certificate from another app? Used in apps: @xxxxx/A (Serial number: xxxxxxx, Certificate ID: xxxxxxxx)
? Will you provide your own Apple Push Notifications service key?
 Let Expo handle the process
? Would you like to reuse Apple Push Notifications service key from another app? xxxxxxx
...
Waiting for build to complete. You can press Ctrl+C to exit.
✖ Build failed.
Standalone build failed!

Hey @maicoineng- could you try logging into the Apple Developer Console? Passing the -c flag clears our records, but doesn’t delete those certificates altogether.

Edit: left this out accidentally-> you may need to revoke any unused certs from there (dev console > Certificates, Identifiers & Profiles) manually

I have also revoked all certificate manually after using -c flag.

I guess I have to use --clear-provisioning-profile before clearing credentials and build again.
not sure it is the expected behavior but it works now.

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