Error: Distribution certificate with fingerprint XXX hasn't been imported successfully

Hey everyone. I’m trying to build an app with EAS (development profile). When I build in cloud, the app builds successfully, but it does not work with iOS 15. So now I’m trying to build locally, and the furthest I have reached is this error with certificate importing.

I found two topics here in the forum with the same problem. The first author says that he cleared some certificates and restarted the computer. The second has been closed with no solution after a timeout.

I looked for any certs/keys/anything with ‘turtle’ in the name, there was nothing. So I’m stuck here for a while and don’t really know what else can I do.

Good old expo build works for me but I need to get eas build working as well.

[PREPARE_CREDENTIALS] 
Error: Distribution certificate with fingerprint XXX hasn't been imported successfully
    at Keychain.ensureCertificateImported (/Users/alekseiaksenov/.npm/_npx/17379/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/build-tools/dist/ios/credentials/keychain.js:54:19)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async IosCredentialsManager.prepareTargetCredentials (/Users/alekseiaksenov/.npm/_npx/17379/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/build-tools/dist/ios/credentials/manager.js:96:13)
    at async IosCredentialsManager.prepare (/Users/alekseiaksenov/.npm/_npx/17379/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/build-tools/dist/ios/credentials/manager.js:54:41)
    at async /Users/alekseiaksenov/.npm/_npx/17379/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/build-tools/dist/builders/ios.js:25:20
    at async BuildContext.runBuildPhase (/Users/alekseiaksenov/.npm/_npx/17379/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/build-tools/dist/context.js:44:28)
    at async Object.iosBuilder (/Users/alekseiaksenov/.npm/_npx/17379/lib/node_modules/eas-cli-local-build-plugin/node_modules/@expo/build-tools/dist/builders/ios.js:24:29)
    at async Object.buildIosAsync (/Users/alekseiaksenov/.npm/_npx/17379/lib/node_modules/eas-cli-local-build-plugin/dist/ios.js:43:27)
    at async Object.buildAsync (/Users/alekseiaksenov/.npm/_npx/17379/lib/node_modules/eas-cli-local-build-plugin/dist/build.js:27:32)
    at async main (/Users/alekseiaksenov/.npm/_npx/17379/lib/node_modules/eas-cli-local-build-plugin/dist/main.js:16:9)

Build failed
Distribution certificate with fingerprint XXX hasn't been imported successfully

Here is my eas.json:

{
  "cli": {
    "version": ">= 0.38.3"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

I looked for any certs/keys/anything with ‘turtle’ in the name, there was nothing.

It’s not necessary sth with turtle in the name, distribution certs that you added manually or maybe via code also can interfere with the build process.

When I build in cloud, the app builds successfully, but it does not work with iOS 15.

If you have managed project on older SDK, it builds on the older version of xcode image by default, you can switch to the newer version by specifying image in eas.json it can be set to latest or specific image name

1 Like

Hi! Thank you for the support. After I upgraded my Expo 41 app to Expo 43, I was able to build in-cloud and run it on my iOS 15 device. The problem with building locally has not gone though now I care less about it. Anyway, I’m unblocked now, thank you!

Hi. I had a problem building locally a few weeks ago, while builds on the build farm worked. I can’t remember the details so quite likely not to be the same as your problem, but might be worth checking:

I had an old version of eas-cli-local-build-plugin installed.

After upgrading that, local builds worked.

EDIT: These days, eas-cli-local-build-plugin is no longer needed. Uninstall it.

1 Like

I’m also running into a similar issue on a pretty fresh Mac Mini (so I haven’t installed many if any certificates at all).

I’ve tried clearing all certificates that are not part of System in my Keychain Access + restarted to no avail.

I’ve also tried upgrading eas-cli-local-build-plugin with no luck.

What version of Xcode do you have installed?

Also, do you have this problem if you create a new app with expo init and build it without making any modifications to it first?

I have 13.1 Build version 13A1030d. It’s an M1 Mac Mini FWIW.

I just tried this with a fresh expo init project (so SDK 43), and I’m still running into the exact same error with the Distribution cert not being imported successfully.

I get the same error in my project (GitHub - denniske/aoe2companion: AoE II Companion) with MacBookPro M1 node 16.13. xcode 13.2.1 and eas-cli-local-build-plugin 0.0.56.

(Command: npx eas build --profile development4 --platform ios --local)

Yep, same problem here.

Adding this to one of the few posts of this topic that are still open. Here’s what the problem was for me:

My understanding is that the distribution certificate added to the temporary keychain is signed by an authority that doesn’t exist by default (at least on my fresh install of Monterey). So when the build process checks whether the import has been successful, it fails because the cert isn’t trusted.

This is the authority certificate that was missing for me https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer

After importing this into my system keychain, the error was gone.

9 Likes

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