I've been having the same issue. Again, was fine in Xcode 15, but very temperamental in Xcode 16.
I'm using Fastlane to build and upload iOS versions and then Catalyst versions of two targets.
The iOS versions always work perfectly.
The Catalyst versions sometimes work.
Sometimes one of the targets works and the other fails.
Sometimes they both fail.
I confirmed that there's nothing that needs agreeing to on the portal, and I've started cleaning the build folder every time just to check.
Even stranger is that sometimes, when I go back to Xcode there are many Unknown Apple ID accounts that have been added to the Accounts section.
They're not always there after a failed upload.
Attaching the image of the failed accounts.
The errors I'm seeing in the Fastlane output are:
Multiple occurrences of this, presumably due to the extra accounts being created:
2024-10-02 23:55:26.239 xcodebuild[53833:26449828] IDEDistribution: Failed to log in with account "(null)" while checking for an App Store Connect account (Error Domain=DVTServicesAccountBasedSessionErrorDomain Code=0 "Unable to log in with account ''." UserInfo={NSLocalizedFailureReason=Unable to log in with account ''., NSLocalizedRecoverySuggestion=The login details for account '' were rejected., DVTDeveloperAccountErrorAccount=<DVTAppleIDBasedDeveloperAccount: 0x600002390b40; username=''>, NSUnderlyingError=0x6000035617d0 {Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={
creationTimestamp = "2024-10-02T22:55:26Z";
httpCode = 200;
protocolVersion = QH65B2;
requestUrl = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action";
responseId = "2630ce6d-d3ef-4782-9aad-91d72813d8ee";
resultCode = 1100;
resultString = "Your session has expired. Please log in.";
userLocale = "en_US";
userString = "Your session has expired. Please log in.";
},
error: exportArchive The operation couldn’t be completed. Unable to log in with account ''.