Code signing identity not propagated to xcodebuild's archive (which fails)

Bitrise Build Issue Report template

On the Xcode Archive step, the CODE_SIGNING_IDENTITY env variable is not overwritten when calling xcodebuild -exportArchive and so the export fails:

[09:37:52] set -o pipefail && xcodebuild "-exportArchive" "-archivePath" "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__archive__902189743/MyApp.xcarchive" "-exportPath" "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__export__095194690" "-exportOptionsPlist" "/Users/vagrant/deploy/export_options.plist" | xcpretty

❌  error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 3.)

If you can't find the reason of the error in the log, please check the raw-xcodebuild-output.log
The log file is stored in $BITRISE_DEPLOY_DIR, and its full path
is available in the $BITRISE_XCODE_RAW_RESULT_TEXT_PATH environment variable
2017-04-20 16:37:54 +0000 [MT] -[IDEDistributionProvisioning _itemToSigningInfoMap:]: Can't find any applicable signing identities for items: (
    "<IDEDistributionItem: 0x7fa98bed27a0 'com.mycompany.myapp'


Always happens

1 Like

Hi @FWFabio,

Can you please follow this guide Xcode exit code 65 / exit code 66 / raw-xcodebuild-output.log and check the IDE Distribution debug logs (attached by Deploy to if you have that step in your workflow)?

If you could not find the reason of the error there, please send us the build URL through email / the onsite chat and we’ll have a look! (But first please make sure you follow the guide I linked above, and that you have the Deploy to step in the workflow as described there)

Hi Viktor,
I think I found the root cause of the problem. The export step pass an export.plist for an app-store build while my provisioning profile is for an enterprise build. Shouldn’t the step select the right one based on the provisioning profile in use?

Well, it’s a bit more complicated than that :wink:

You’re free to upload any number of profiles. You can e.g. upload both an Ad Hoc and an App Store signing profile, and then export an IPA with both an Ad Hoc and then with an App Store signing, in the same build. All you have to do is to use two Xcode Archive steps (or an Xcode Archive and then a Export … Xcode archive step), setting one to Ad Hoc and the other to App Store.

Or simply have one workflow with Ad Hoc, and another one with App Store signing. You’ll still have all the prov profiles available.

By trying to reply to you I realise that I had mistakenly locked the build to app-store and not auto-detect. All sorted now, I should’ve read the settings better to start with!


1 Like

Well, to be honest, we’re aware that the settings grew “quite a bit” since the start of the popular steps (like, the number of available options of Xcode Test grew ~10x), and can be quite a pain to go through… We’re working on a couple of things which will help with that, hopefully :wink: