Xcode 9 GM - Failed to create target code sign properties mapping, error

Based on: xcodebuild -h output:

Allow xcodebuild to communicate with the Apple Developer website.
For automatically signed targets, xcodebuild will create and update profiles, app IDs, and certificates.
For manually signed targets, xcodebuild will download missing or updated provisioning profiles.
Requires a developer account to have been added in Xcode’s Accounts preference pane.

Regarding to:

You have several options to keep Automatic code singing setting in your project:

1, Automatic code signing on bitrise

  • use codesingdoc to export your certificate and profiles
    these profiles will be the xcode generated ones, so they need to be updated periodically on bitrise, since automatically managed profiles are expiring

  • use auto-detect export method in xcode-archive step.

This way both the archive and ipa export process will use Xcode managed singing files

2, Force Manual singing on bitrise

  • generate the desired singing files on the developer portal and upload them to bitrise
  • force manual code singing by adding: CODE_SIGN_STYLE="Manual" to Additional options for xcodebuild call input.
  • force the development team, code sign identity and profile (Force code signing with Development Team, "Force code signing with Code Signing Identity and Force code signing with Provisioning Profile step inputs
  • use auto-detect export method in xcode-archive step.

This way you force xcodebuild to use the uploaded code sign files

1 Like

@godreikrisztian

Thanks for response. I have already tried everything before and so far the only way to make build works is set provisioning profile manually.

I used codesigndoc and uploaded files to bitrise. I set Automaically manage signing in Xcode. I also used auto-detect option in export method. But I got this error.

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
Archive failed, error: exit status 65

And below is the raw-codebuild-output.log.

Check dependencies
Code Signing Error: No profiles for ‘com.fishtrack.app’ were found: Xcode couldn’t find any iOS App Development provisioning profiles matching ‘com.fishtrack.app’. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
Code Signing Error: Code signing is required for product type ‘Application’ in SDK ‘iOS 11.0’
** ARCHIVE FAILED **

And this is what bitrise used to build:

$ set -o pipefail && xcodebuild “-workspace” “FishTrack.xcworkspace” “-scheme” “FishTrack” “clean” “archive” “-archivePath” “/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__archive__990969929/FishTrack.xcarchive” | xcpretty

So where are we at with this issue?

I just retried my Bitrise build with Xcode 9 GM using 2.3.0 of the Xcode Archive & Export step. I’m not using any of the “Force code signing with…” options.

It no longer gives the original “Failed to create target code sign properties mapping” error, which seems like progress.

  • When “Select method for export” is set to auto-detect, it builds successfully but only signed with the Developer certificate
  • When “Select method for export” is set to ad-hoc, it fails with:
    ▸ Archive Succeeded
    Exporting ipa from the archive...
    Using export options
    Generating export options
    using export-method input: ad-hoc
    xcode major version > 9, generating exportOptions with provisioningProfiles node
    project does not specify profile for: com.solium.SwPtpMobile, seraching for installed profile for export method: ad-hocs
    Failed to find matching provisioning profiles for: $MY_REDACTED_BUNDLE_ID
  • When “Select method for export” is set to app-store, it fails with a similar error:
    ▸ Archive Succeeded
    Exporting ipa from the archive...
    Using export options
    Generating export options
    using export-method input: ad-hoc
    xcode major version > 9, generating exportOptions with provisioningProfiles node
    project does not specify profile for: com.solium.SwPtpMobile, seraching for installed profile for export method: app-stores
    Failed to find matching provisioning profiles for: $MY_REDACTED_BUNDLE_ID

Note the odd plural on “ad-hocs” and “app-stores”.

Do I need to do something else to get the Ad Hoc and App Store builds to work? (I do have valid provisioning profiles for both of those in my Bitrise app > Code Signing section).

Thanks!

Same problem here https://www.bitrise.io/build/afcd2305adb2349f

Running into the same issue :confused:
Export options: app-store
Force Signing Build Settings: No set
Automatically manage signing is turned on in XCode
Not passing -allowProvisioningUpdates
Build URL: https://www.bitrise.io/build/d2e386c0b3b0c84d
Error: Failed to create target code sign properties mapping, error: failed to run ruby script

It seems that there’s an issue in the Xcode Archive step that is causing these errors. We’re working on the fix and will post back here once the new step version is deployed.

In the meantime the workaround is detailed in this blogpost: https://blog.bitrise.io/new-export-options-plist-in-xcode-9

Only important thing I’d add to the post is: when you do the export from Xcode, don’t select the Automatic option (see screenshot below).

05

1 Like

We’ve released a new version (2.3.1) of Xcode Archive & Export for iOS step.
This version contains a lot of fixes related to the new provisioningProfiles node in the exportOptions.plist. Please update to this version and let us know how it goes!

Thanks for the reports and all your help!

1 Like

I’m still seeing a problem with 2.3.1. My developer certificate expired yesterday, so it’s possible I’m doing something wrong. I re-ran the codesignexport and uploaded the new certs.

I built it with export method of ad-hoc. Here’s what I get:

Exporting ipa from the archive...
Using export options
Generating export options
using export-method input: ad-hoc
xcode major version > 9, generating exportOptions with provisioningProfiles node
generated export options content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>method</key>
		<string>ad-hoc</string>
		<key>provisioningProfiles</key>
		<dict>
			<key>com.solium.SwPtpMobile</key>
			<string>c6c2c840-9e0d-4262-b3d4-fc5239e7e44e</string>
		</dict>
	</dict>
</plist> <nil>

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

❌  error: exportArchive: No profiles for 'com.solium.SwPtpMobile' were found

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
IDEDistribution.critical.log:
2017-09-21 16:52:10 +0000 [MT] Step failed: <IDEDistributionSigningAssetsStep: 0x7f7ff8751010>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
    "Error Domain=IDEProfileLocatorErrorDomain Code=1 \"No profiles for 'com.solium.SwPtpMobile' were found\" UserInfo={NSLocalizedDescription=No profiles for 'com.solium.SwPtpMobile' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS Ad Hoc provisioning profiles matching 'com.solium.SwPtpMobile'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}"
)}

I am pretty confused by this. In the certificate-and-profile-installer step it installs the profile that’s references above, c6c2c840-9e0d-4262-b3d4-fc5239e7e44e.

Any idea what I’m doing wrong?

Here is the build if you want to take a look:
https://www.bitrise.io/build/fdedf2860c62b634

3 Likes

I still have the same issue.

https://www.bitrise.io/build/ce68dd938ddeef51

Just to update, I confirmed my provisioning profiles and Identities are working on Xcode 8 stack, it’s just the Xcode 9 stack I’m having a problem with.

Also seeing issues: https://www.bitrise.io/build/4cd305a8e4ad378b

Thank you for reporting, it seems like Xcode 9 is being particularly stubborn this time.
We’re looking into this and will post a fix asap! Until then you can use the workaround suggested in my earlier post in this thread:

Sorry for the inconvenience!

@trick14 & @shaddeen please create separate issues with the logs in #issues:build-issues so that we can track & notify those.

I’m also having the same issue with my builds.

Hi @hearst,
we are working on the fix, until we release a new version please use this workaround: Xcode 9 GM - Failed to create target code sign properties mapping, error

1 Like

Do you have an ETA? The work around does not fit our current workflow.

1 Like

This have to be done on this week.

3 Likes

Hi,
we released a new version of the step: 2.3.2.
Please update the step in your workflows and do not forget to update Certificate and Profile Installer step to the latest version (1.9.0) as well.
Let us know how does it work four you!

Do we still need the workaround for this one? I’m getting a different error.

Generating export options
auto-detect export method, based on embedded profile
embedded provisioning profile: <*******> (************-24ca-****-b43b-************) - export method: development
xcode major version > 9, generating exportOptions with provisioningProfiles node
Failed to create scheme - target mapping, error: failed to run ruby script, output: {"error":"project does not contain scheme: <******>\n/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__ruby-script-runner__997203688/script.rb:124:in `read_scheme_target_mapping'\n/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__ruby-script-runner__997203688/script.rb:164:in `<main>'"}, error: exit status 1
Please contact us on bitrise on-site-chat and
attach your failed build log file (+ raw-xcodebuild-log if any) and
your project's .xcodeproj file, to let us identify the issue.

After updating my stack to Xcode 9 and updating the steps to 2.3.2 and 1.9.0 I’m getting the error:

❌  error: exportArchive: No profiles for 'org.myOrg.myApp' were found