Standalone build failed! (iOS certificate replacement)

Last year, I built an app with an iOS enterprise certificate. It was used well, but it is preparing for replacement because it is valid for 1 year.

Certificate information was initialized with the ‘expo: build -c’ command. Then, I uploaded the * .mobileprovision file as the replaced file. However, the following error occurred.

✖ Build failed.
Standalone build failed!

The detail log is as follows.

Error: codesign ident not present in find-identity: *************************************
Looking for identities matching "(************)"
     0 valid identities found

    at Object.ensureCertificateValid (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosCodeSigning.js:123:11)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)

Am I missing something? Or should I replace * .p8 and * .p12 etc?
That files are still valid for about two years, and are in use by other enterprise apps, so they are unlikely to change.

Additional,
It’s weird, even if I build with an existing certificate, I get an error. What should I do?

Hi, I didn’t totally understand what steps did you take.
To reset certificate you should run
expo build:ios --clear-provisioning-profile --clear-dist-cert
or
expo build:ios -c if you don’t mind removing also push notification credentials

In dialog in build command, you should either Let expo handle it for everything or generate provisioning profile and cert and pass them both manually. Based on your post I understand that you generated a certificate using expo, but for some reason, you passed provisioning profile manually.

@wkozyra
Hi. First of all, Thank you for the answer.

I did this command. expo build:ios -c However, as shown in the above article, a failure log appeared. And even if I build with the old certificate, it fails. also I build manually. not Let expo handle it

What I don’t understand is that the same error occurs when I use the expo build:ios -c command using my previous(It works before) mobile provision file. What should I do?

And even if I build with the old certificate, it fails. also I build manually not Let expo handle it

Are you saying that you provide credentials only manually or did you tried both ways?

I uploaded the * .mobileprovision file as the replaced file. However, the following error occurred.

What about certificate, * .mobileprovision is only provisioning profile

What I don’t understand is that the same error occurs when I use the expo build:ios -c command using my previous(It works before) mobile provision file. What should I do?

Are you sure that you didn’t expire already or was revoked on apple developer portal?

What did you select when running expo build:ios -c? The actual terminal output would be useful

The *.p12 certificate hasn’t expired, so it’s still well used in current apps. (I rebuilt yesterday. It works fine.) However, *.mobileprovision is expected to expire in April. So I rebuilt and got an error.

This is my apple developer portal information.

Name: CJ_SHR_DEV_20200212
Status: Active
Type: Universal Distribution
Expires: 2021/02/11
App ID: CJ SHR DEV (com.cj.group.shrdev)

This is my command. Some information was masked.

expo build:ios -c                                                 SIGINT(2) ↵  5347  11:09:58
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                                                                          │
│   There is a new version of expo-cli available (3.13.1).                                                                                 │
│   You are currently using expo-cli 3.12.0                                                                                                │
│   Install expo-cli globally using the package manager of your choice; for example: `npm install -g expo-cli` to get the latest version   │
│                                                                                                                                          │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Checking if there is a build in progress...

Removed existing credentials from expo servers
Please enter your Apple Developer Program account credentials. These credentials are needed to manage certificates, keys and provisioning profiles in
your Apple Developer account.
The password is only used to authenticate with Apple and never stored.
? Apple ID: chanho.jung@cj.net
? Password (for chanho.jung@cj.net): [hidden]
Trying to authenticate with Apple Developer Portal...
Available session is not valid any more. Continuing with normal login.
Authenticated with Apple Developer Portal successfully!
Only 1 team associated with your account, using Apple Team with ID: T************9
We are missing the following credentials from you: Apple Distribution Certificate, Apple Push Notifications service key, Apple Provisioning Profile
? How would you like to upload your credentials? I will provide all the credentials and files needed, Expo does limited validation

WARNING! In this mode, we won't be able to make sure your Distribution Certificate,
Push Notifications service key or Provisioning Profile are valid. Please double check
that you're uploading valid files for your app otherwise you may encounter strange errors!

Make sure you've created your app ID on the developer portal, that your app ID
is in app.json as `bundleIdentifier`, and that the provisioning profile you
upload matches that team ID and app ID.

Please provide your Apple Distribution Certificate:
? Path to P12 file: /Users/cj-user/Documents/ios_cert/CJON_DEV_CERT_180327.p12
? P12 password: [hidden]
Please provide your Apple Push Notifications service key:
? Path to P8 file: /Users/cj-user/Documents/ios_cert/AuthKey.p8
? Key ID: *************
Please provide your Apple Provisioning Profile:
? Path to .mobile provisioning profile: /Users/cj-user/Documents/ios_cert/CJ_SHR_DEV_20200212.mobileprovision


...
...
...

> Analyzing 4 sources
> Rewriting sources
> Adding source map references
> Bundled 4 files for upload
> Uploaded release files to Sentry
> File upload complete

Source Map Upload Report
  Minified Scripts
    ~/main.android.bundle (sourcemap at main.android.map)
    ~/main.ios.bundle (sourcemap at main.ios.map)
  Source Maps
    ~/main.android.map
    ~/main.ios.map

Published
Your URL is

https://exp.host/@chanho/DEV-SHRApp

› Closing Expo server
› Stopping Metro bundler
Checking if this build already exists...

Build started, it may take a few minutes to complete.
You can check the queue length at https://expo.io/turtle-status

You can make this faster. 🐢
Get priority builds at: https://expo.io/settings/billing

You can monitor the build at

 https://expo.io/dashboard/chanho/builds/18e3e2b2-dd9a-43e7-b074-381a8f820585

Waiting for build to complete. You can press Ctrl+C to exit.
✖ Build failed.
Standalone build failed!

and this is expo build error message

building and signing IPA
saved provisioning profile to temporary path
provisioning profile copied to home directory
done retrieving provisioning profile data
checking if teamID is present in keychain and that certificate is valid...
removed provisioning profile from the home directory
Error: codesign ident not present in find-identity: 5A4***********************26B
Looking for identities matching "(T**********9)"
     0 valid identities found

    at Object.ensureCertificateValid (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosCodeSigning.js:123:11)
    at <anonymous>

Is there any information that would be more helpful? This is important to me.
Thank you!

Are you sure that all the credentials were generated on that team?

can you run expo credentials:manager and show credentials listing there?

com.cj.group.shr is well built now. but com.cj.group.shrdev should not be. (and this case)

pplication credentials

  Experience: @chanho/CafeteriaApp, bundle identifier: net.cj.mhr
    Provisioning profile is missing. It will be generated during the next build
    Apple Team ID: 8R3C5472LX,  Apple Team Name: ---------

  Experience: @chanho/DEV-SHRApp, bundle identifier: com.cj.group.shrdev
    Provisioning profile is missing. It will be generated during the next build
    Apple Team ID: T**********9,  Apple Team Name: ---------

  Experience: @chanho/SampleApp, bundle identifier: com.chanho.sample
    Provisioning profile is missing. It will be generated during the next build
    Apple Team ID: 8R3C5472LX,  Apple Team Name: ---------

  Experience: @chanho/SampleApp, bundle identifier: ios.chanho.sample
    Provisioning profile is missing. It will be generated during the next build
    Apple Team ID: 8R3C5472LX,  Apple Team Name: ---------

  Experience: @chanho/sHRApp, bundle identifier: com.cj.group.shr
    Provisioning profile is missing. It will be generated during the next build
    Apple Team ID: T**********9,  Apple Team Name: ---------


User credentials

  Distribution Certificate - Certificate ID: -----
    Apple Team ID: T**********9,  Apple Team Name: ---------
    used by
      @chanho/DEV-SHRApp (com.cj.group.shrdev)

  Distribution Certificate - Certificate ID: -----
    Apple Team ID: T**********,  Apple Team Name: ---------
    used by
      @chanho/sHRApp (com.cj.group.shr)

  Push Notifications Key - Key ID: BX8QPRZL2Y
    Apple Team ID: T7TNVZK469,  Apple Team Name: ---------
    used by
      @chanho/sHRApp (com.cj.group.shr)

  Push Notifications Key - Key ID: BX8QPRZL2Y
    Apple Team ID: T**********9,  Apple Team Name: ---------
    used by
      @chanho/DEV-SHRApp (com.cj.group.shrdev)

Does anyone know what the problem is?

Hi, sorry I forgot about your post.

It seems that provisioning profile, distribution certificate or apple account you are specifying mismatch in some way

If everything is on the same apple team and valid and team id you specified (T7TNVZK469) is correct, only reason I can think of is that you created new provisioning profile first and dist cert leater and because of that provisioning profile does not contain certificate information.

Sorry. We have someone who manages certificates. I asked him for a certificate again.
It works great with other (live *.p12) certificates.

Thank you.