I went ahead and generated a new key, but I am still unable to get this to work.
The original error is gone, but now I receive a 401 error from the developer portal using Xcode 16 RC (16A242):
env NSUnbufferedIO=YES xcodebuild clean archive -workspace MyApp.xcworkspace -scheme MyApp -configuration Release -archivePath results/artifacts/App.xcarchive -destination generic/platform=iOS -derivedDataPath build -allowProvisioningUpdates -authenticationKeyID **** -authenticationKeyIssuerID **** -authenticationKeyPath /Users/MyUser/MyKey.p8
GatherProvisioningInputs
2024-09-12 07:40:48.226 xcodebuild[41720:6825977] DVTServices: Received response for 0119471B-B1ED-435F-B036-97D661247558 @ <https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA>. Error = Error Domain=DVTPortalResponseErrorDomain Code=0 "Communication with Apple failed" UserInfo={NSLocalizedDescription=Communication with Apple failed, NSLocalizedRecoverySuggestion=A non-HTTP 200 response was received (401) for URL https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA}
2024-09-12 07:40:48.393 xcodebuild[41720:6825977] DVTServices: Received response for 7A81B4FA-E41E-47BB-9C7A-D641D09BB9C2 @ <https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA>. Error = Error Domain=DVTPortalResponseErrorDomain Code=0 "Communication with Apple failed" UserInfo={NSLocalizedDescription=Communication with Apple failed, NSLocalizedRecoverySuggestion=A non-HTTP 200 response was received (401) for URL https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA}