[build:ios] Failed PKCS#12 MAC could not be verified. Invalid password?

I upgraded expo sdk and making the build for ios, but got the error.

Here is my env

Expo CLI 2.21.2 environment info:
    System:
      OS: macOS 10.14.5
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.16.0 - /usr/local/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5014246
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^33.0.0 => 33.0.7 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz => 0.59.8 
    npmGlobalPackages:
      expo-cli: 2.21.2

And here is the error.

$ expo build:ios
? Apple ID: ***
? Password: ***
Trying to authenticate with Apple Developer Portal...
Authenticated with Apple Developer Portal successfully!
Only 1 team associated with your account, using Apple Team with ID: ***
We do not have some credentials for you: Apple Distribution Certificate, Apple Push Notifications service key, Apple Provisioning Profile
? 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
✖ Failed when trying to find previously uploaded Apple Distribution Certificate
PKCS#12 MAC could not be verified. Invalid password?

I used the same account to login the expo with the previous build.
Does any one got the same issue.

Hey @alesca,

It looks like this user encountered this as well https://github.com/expo/expo-cli/issues/738 and it turned out they were logged into a different account. Can you double check that both your Expo account and Apple Dev accounts are the ones previously used? You can run expo whoami to check the current auth status.

Cheers,
Adam

Thanks @adamjnav for replying.
I have only one accout for building this app (both expo account and app store account)

I have checked the previous builds on expo with this accout.
So I think that is not the reason of the build issue.

Hi
Can you try those credentials on clean expo app?
Run expo fetch:ios:certs and build clean expo init app with the same bundle identifier and using credentials that first command will display and save to disk.
Also make sure that password displayed make sens(empty string or sth like that).

Hi @wkozyra.
Thanks so much for your reply.

I got the issue and tried some times but it did not work.
Then I’ve tried to build with no cache build:ios -c
So the certs were cleared and no longer exist in the expo now.
Now I try to build as the initial time, but it still got the same error.

I also tried create the new one with expo init.
Then built with the same bundle identifier or with the new one.
But it did not solve the issue.

Before generating new credentials expo-cli lists all available on your account and propose to reuse them. In your case processing of those credentials seems to fail on one of them, most likely when extracting a serial number from distribution certificate.

It will be fixed within a few days, but if you want I can remove all distribution certificates on your expo account from db directly and next build should generate them correctly.

Thanks @wkozyra for your help.
Could you please remove the distribution certs on my account as you said.
I will build and create the new one.

Cheers,

I removed it, but still need to run first build with -c to remove provisioning profile.