Re-downloading won't fix this one. A provisioning profile only trusts the specific certificate(s) it was generated against at the time — if the certificate got regenerated (or is new) after the profile was created, downloading the same old profile file again just gets you the same stale trust list, no matter how many times you do it.
The fix is to regenerate the profile itself, not redownload it: go to the profile in the Developer portal, open it, and hit regenerate (this re-links it to whichever certificate is currently active on your account), then download that new file. Worth confirming first which certificate is actually current with security find-identity -v -p codesigning so you know what the profile should be pointing at.
I ran into this building the CI pipeline behind macless.dev and ended up writing a free script that checks whether a cert's fingerprint actually matches what's embedded in a profile, so you can catch this before a build fails on it: github.com/jackson26-source/macless-signing-doctor.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: