I’m having problems generating (or retrieving) distribution certificates when running expo build:ios.
I’m getting the error:
Failed when trying to find previously uploaded Apple Distribution Certificate
_getCertData only takes strings and buffers.
I’m sure I’m using the right credentials when login-in on expo and apple.
I’ve tried with expo build:ios -c and got the same error.
I’ve tried deleting all distribution certificates from developer.apple.com and got the same error.
I’ve tried deleting and re-creating manually the distribution certificate from developer.apple.com, downloading it, converting it to p12 and providing it to expo build:ios with the right password, and the result was:
Failed to generate Apple Provisioning Profile
Reason: No cert available to make provision profile against, raw: "Make sure you were able to make a certificate prior to this step.
Reason: No cert available to make provision profile against, raw: "Make sure you were able to make a certificate prior to this step.
I ran into this earlier, and just deleted some old profiles on developer.apple.com, rebuild with the -c flag, and was all good to go. Not sure if you’ve already tried that
I’m wondering what’s going on with this error. It’s like expo for some reason cannot fetch previously created (or none) certificates from the developer portal.
I have the same problem and got the same error.
I’ve tried deleting profiles from apple developer account as well.
Expo SDK 33, Expo CLI 3.0.4
× Failed when trying to find previously uploaded Apple Distribution Certificate
_getCertData only takes strings and buffers.
Error: _getCertData only takes strings and buffers.
at _getCertData (C:\@expo\xdl@56.1.3\src\detach\IosCodeSigning.js:44:11)
at Object.findP12CertSerialNumber (C:\@expo\xdl@56.1.3\src\detach\IosCodeSigning.js:35:20)
at distCerts.map (C:\@expo\xdl@56.1.3\src\credentials\IosCredentials.js:43:41)
at Array.map (<anonymous>)
at formatDistCerts (C:\@expo\xdl@56.1.3\src\credentials\IosCredentials.js:42:20)
at getExistingDistCerts (C:\@expo\xdl@56.1.3\src\credentials\IosCredentials.js:38:10)
at process._tickCallback (internal/process/next_tick.js:68:7)
The dist certs are fetched here by calling getExistingUserCredentials. Then the code tries to format them.
It looks like the fetched certs each include a P12 cert bundle which is passed in to IosCodeSigning.findP12CertSerialNumberhere.
That then calls _getCertDatahere, which calls _getCertData, which looks like this:
function _getCertData(p12Buffer, passwordRaw) {
if (Buffer.isBuffer(p12Buffer)) {
p12Buffer = p12Buffer.toString('base64');
} else if (typeof p12Buffer !== 'string') {
throw new Error('_getCertData only takes strings and buffers.');
}
[...]
So it seems that getExistingUserCredentials is returning a P12 cert that is invalid in some way. Maybe it’s in the wrong format?