Fixing `error: exportArchive: Communication with Apple failed`

Today I tried to publish an iOS app and guess what, it failed...

Building App Store IPA...                                          15.2sEncountered error while creating the IPA:error: exportArchive: Communication with Apple failederror: exportArchive: No signing certificate "iOS Distribution" founderror: exportArchive: Communication with Apple failed
Try distributing the app in Xcode: "open /Users/anhtuan/git/trading_journal/build/ios/archive/Runner.xcarchive"
error: exportArchive: No signing certificate "iOS Distribution" found
Error Domain=IDECodesignResolverErrorDomain Code=1 "No signing certificate "iOS Distribution" found" UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedRecoverySuggestion=No "iOS Distribution" signing certificate matching team ID "CAA83HY4JS" with a private key was found., IDEProvisioningError_UserInfoKey_IDEProvisioningErrorSpecifier=iOS Distribution, NSLocalizedDescription=No signing certificate "iOS Distribution" found,, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorAction=5, IDEProvisioningError_UserInfoKey_IDEProvisioningErrorTeam=<IDEProvisioningBasicTeam: 0x1343087e0; teamID='CAA83HY4JS', teamName='(null)'>}

Even though it tells me to do it in XCode, a quick search on Google tells me I should sign in to my developer account.

[Gym] Signing with Xcode 13 fails because no provisioning profiles were found · Issue #19377 · fastlane/fastlane
New Issue Checklist Updated fastlane to the latest version I read the Contribution Guidelines I read I searched for existing GitHub issues Issue Description We use fastlane gym ...

In XCode everything looks fine, but on my account, sure enough it tells me:

Developer Program Membership Expired

It would be nice if the it told me so the first time I ran the compilation.