xcodebuild -exportArchive fails for developer-id signed app

We use the xcodebuild -exportArchive command to export our app. This command has code signing issues with Xcode 13, where apparently a communication with Apple failed. The command is executed on macOS 12.0 Beta (21A5304g). By switching to Xcode Version 12.2 (12B45b) using xcode-select, the export works under equal conditions! This seems to be a regression in Xcode 13. Our iOS and Mac App Store builds export fine, this only affects the developer-id build.

I would like to ask if this is a bug/regression that we can expect to be fixed. If you need further information / logs, I will happily provide them.

The command:

xcodebuild \                                                                    
    -exportArchive \
    -archivePath „xy.xcarchive" \
    -exportOptionsPlist "ExportOptions.plist" \
    -exportPath  „$exportPath“ \
    -allowProvisioningUpdates

The command output:

Error Domain=DeveloperAPIServiceErrorDomain Code=5 "Communication with Apple failed." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedRecoverySuggestion=You are not allowed to perform this operation.  Please check with one of your Team Admins, or, if you need further assistance, please contact Apple Developer Program Support. https://developer.apple.com/support, NSLocalizedDescription=Communication with Apple failed.}

error: exportArchive: No profiles for ’bundle-identifier’ were found

Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for 'bundle-identifier' were found" UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=No profiles for 'bundle-identifier' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any Developer ID provisioning profiles matching 'bundle-identifier'.}

error: exportArchive: Communication with Apple failed.

Error Domain=DeveloperAPIServiceErrorDomain Code=5 "Communication with Apple failed." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedRecoverySuggestion=You are not allowed to perform this operation.  Please check with one of your Team Admins, or, if you need further assistance, please contact Apple Developer Program Support. https://developer.apple.com/support, NSLocalizedDescription=Communication with Apple failed.}

error: exportArchive: No profiles for 'bundle-identifier.shareextension' were found

Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for 'bundle-identifier.shareextension' were found" UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=No profiles for 'bundle-identifier.shareextension' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any Developer ID provisioning profiles matching 'bundle-identifier.shareextension'.}

Also filed as FB9560862.

Answered by mangerlahn in 687203022

We were able to resolve this issue. Our problem was that for some provisioning profiles an older, still valid signing certificate was selected. This appeared to be no issue with Xcode 12, but is one with Xcode 13. Selecting the newest signing certificate for each provisioning profile fixed the issue.

Accepted Answer

We were able to resolve this issue. Our problem was that for some provisioning profiles an older, still valid signing certificate was selected. This appeared to be no issue with Xcode 12, but is one with Xcode 13. Selecting the newest signing certificate for each provisioning profile fixed the issue.

Seeing the same thing. We're using automatic provisioning though. Anyone figured out a fix?

It fails when we try and export an archive from within Xcode too. I'm on macOS 11.5.2 with Xcode 13 RC.

I have the same issue. Xcode Version 13.0 (13A233). Mac 11.3.1 (20E241) This is blocking issue, preventing us from uploading new build to App Store.

same issue..

"Solved it" by going back to Xcode 12.5.1 for the moment.

It is the blocking issue for our deployment

For those who had trouble with uploading to TestFlight using automatic signings:

What worked for me was, go to https://developer.apple.com/account/resources/profiles/list, create a provisioning profile by clicking on the '+' icon next to Profiles, and, when asked "what type of provisioning file do you need" click on the App Store option under Distribution. after that it should be straightforward. It is not a solution but it is a workaround. I hope you all submitted a bug to Apple about this. Good luck.

Same issue, and I tried to recreate the Provisioning file but it didn't work. Then I login this web: https://appstoreconnect.apple.com/access/users and find my role is App Manage then the holder change my role to Admin, and I try to upload app to App Store Connect no error threre! This could be a reason for error occurred with xcode13.

I have the same issue when trying to use Automatic signing for my app and upload it to the AppStore via Organizer. I get the following errors:

"Communication with Apple failed. You are not allowed to perform this operation. Please check with one of your Team Admins, or, if you need further assistance, please contact Apple Developer Program Support, https://developer.apple.com/support"

"No profiles for '<bundle_id>' were found. Xcode couldn't find any iOS App Store provisioning profiles matching '<bundle_id'>"

Manual signing works fine, looks like a bug to me cause it was working fine since Xcode 12.x

Currently using: Xcode Version 13.0 (13A233). Mac 11.6

I was able to resolve this issue by enabling "Access to Cloud Managed Distribution Certificate" in App Store Connect -> Users and Access for my account.

The issue seems to stem from the new cloud signing feature from wwdc21-10204. In my situation, Xcode 13 was failing to recognize the locally installed distribution certificate and attempted to use cloud signing (see https://help.apple.com/developer-account/#/dev8e84490b9 under "Configure for local signing").

Hope this helps someone else!

13

I also had the same issue that was reported here. Downgrading to 12.5.1 seemed to resolve the issue for now.

Also seeing this issue

I'm also seeing this issue

xcodebuild -exportArchive fails for developer-id signed app
 
 
Q