IPA Doesn't Build, Expo loops building certificates that it then doesn't even use

Hello everyone,

I’ve been trying to build the latest version of my iOS App that in the past I have successfully built four versions of using different versions of expo (28, & 30 to be specific)

Today I tried building my latest build and the following happened across my entire day up till writing this post:

Morning (9 - 12) I run expo build:ios, no issue, expo publish, no issue, then I finally run expo upload:ios and it inexplicably starts hanging when I get to the login portion (it’d hang on 2FA). It finally claims my App Specific Password is an invalid string and I decide I need to clear my credentials and put them back into expo

Afternoon: I rerun upload:ios to no success until i’m forced to run build:ios -c so that Expo can have some means of refreshing my Apple credentials. Afterward I tell expo to handle credentials (I assume after logging in it would see the valid credentials in the app store connect page for the team I’m associated with because it had said such credentials were valid (provisioning profile, distribution, and push certificates) only for it to throw an error saying that my machine did not have the certificate that corresponded to the provisioning profile, at this point I check my Keychain which does in fact have the Distribution Cert and the App Store Connect page, regardless I run the build command again for expo to then say the old keys are duplicates (notice it didn’t make new certificates before it touched the old ones) and should be deleted. I very hesitantly delete the old certificates and proceed to allow Expo to make new certificates for the new version and change the version number in the app.json so it can even create a new build; this is where my nightmare starts

Nightmare time: I notice that at this point Expo notes (in yellow) that it doesn’t have my certificates on file, I tell it to make new certificates (I deleted every certificate of importance on app store connect) so it could make fresh certs for this new version, however Expo gets to asking me about if I want to re-use distribution certificates which it before told me weren’t valid I say no make new ones and then the build fails with the following error(s):

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...
ensured certificate is valid
validating provisioning profile...
removed provisioning profile from the home directory
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:273:11)
    at Object.validateProvisioningProfile (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosCodeSigning.js:265:3)
    at Object.<anonymous> (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosIPABuilder.js:73:53)
    at Generator.next (<anonymous>)
    at step (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosIPABuilder.js:52:191)
    at /usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosIPABuilder.js:52:361
    at <anonymous>

NOTE: There was also a time I did try with one of the pre-existing ghost distribution profiles and it throws a similar error to this one claiming the IPA wasn’t signed with a Apple Submission Signature (what?)

I don’t understand how to fix the error that seems to happen before an .IPA is even made and running build:ios Doesn’t fix this because there’s no manual means of IPA uploading that i’ve discovered. I’m at a loss when it seems like the expo-cli is intent on holding invalid credentials but then complaining it can’t get new ones even when I try manually feeding it a generated p12, of course then the problem is it asks for the p12’s password but it was generated by the App Store page, I don’t know what it is? Very frustrated with little to no clear answer short of re-doing the entire project which just isn’t possible

EDIT: even running : exp build:ios --clear-credentials --revoke-apple-dist-certs --revoke-apple-push-certs --revoke-apple-provisioning-profile does not fix this problem Expo will just mention the two ghost certificates and mention how they have no associated distribution cert or break when making a new provision saying that the new provision isn’t associated with the new distribution certificate made by expo and this just seems like a cyclical problem.

Hi @sasorizero- really sorry you’re having so much trouble with this :confused:

You’ve already tried a lot of the fixes I would suggest off the bat (although I should mention exp was deprecated a while ago for expo)

What version of expo-cli are you using?

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