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

**URL:** <https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705>\
**Category:** Issues\
**Created:** [September 13, 2017, 9:03pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705 "2017-09-13T21:03:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy.gale](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@jeremy.gale](https://discuss.bitrise.io/u/jeremy.gale)\
**Post date:** [September 13, 2017, 9:03pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/1 "2017-09-13T21:03:19Z")

</div>

Hi there,

I’m trying to build my app on with the Xcode 9 GM stack.

It runs the tests and builds the archive fine. Here is the error I get:

```
▸ Archive Succeeded
Using export options
Generating export options
using export-method input: ad-hoc
Failed to create target code sign properties mapping, error: failed to run ruby script, output: {"error":"undefined method `[]' for nil:NilClass\n[\"/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/ __ruby-script-runner__ 154720919/script.rb:36:in `block (3 levels) in read_code_sign_map'\", \"/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/ __ruby-script-runner__ 154720919/script.rb:30:in `each'\", \"/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/ __ruby-script-runner__ 154720919/script.rb:30:in `block (2 levels) in read_code_sign_map'\", \"/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/ __ruby-script-runner__ 154720919/script.rb:27:in `each'\", \"/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/ __ruby-script-runner__ 154720919/script.rb:27:in `block in read_code_sign_map'\", \"/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/ __ruby-script-runner__ 154720919/script.rb:25:in `each'\", \"/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/ __ruby-script-runner__ 154720919/script.rb:25:in `read_code_sign_map'\", \"/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/ __ruby-script-runner__ 154720919/script.rb:57:in `<main>'\"]"}, error: exit status 1
| |
+---+---------------------------------------------------------------+----------+
| x | xcode-archive (exit code: 1) | 469 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-xcode-archive/issues |
| Source: https://github.com/bitrise-io/steps-xcode-archive |
+---+---------------------------------------------------------------+----------+

```

Here is the build that failed:

```
https://www.bitrise.io/build/3ba268e04ca1344d

```

I’m using the latest version of the Xcode Archive & Export plugin, 2.2.1.

---

<div class="post-metadata">

**Author:** ![Ezor](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@Ezor](https://discuss.bitrise.io/u/Ezor)\
**Post date:** [September 14, 2017, 9:02am UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/2 "2017-09-14T09:02:13Z")

</div>

Hi guys, same problem here : [https://www.bitrise.io/build/dce45a5ec8b94cff](https://www.bitrise.io/build/dce45a5ec8b94cff)

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/daniel/32/20_2.png) [@daniel](https://discuss.bitrise.io/u/daniel)\
**Post date:** [September 14, 2017, 11:53am UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/3 "2017-09-14T11:53:55Z")

</div>

Hi @jeremy.gale & @Ezor, thanks for reporting - we’ll look into this asap!

---

<div class="post-metadata">

**Author:** ![trick14](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/trick14/32/819_2.png) [@trick14](https://discuss.bitrise.io/u/trick14)\
**Post date:** [September 15, 2017, 5:57pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/4 "2017-09-15T17:57:29Z")

</div>

I have same issue. @daniel Do you have any progress so far?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [September 15, 2017, 6:00pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/5 "2017-09-15T18:00:34Z")

</div>

A new Xcode Archive step was just released. Did you try that? If you’d still get the issue with the new version please share your build url via the [bitrise.io](http://bitrise.io) onsite chat support.

---

<div class="post-metadata">

**Author:** ![trick14](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/trick14/32/819_2.png) [@trick14](https://discuss.bitrise.io/u/trick14)\
**Post date:** [September 15, 2017, 7:42pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/6 "2017-09-15T19:42:54Z")

</div>

Here’s what I did so far.

I deleted Xcode 8 and 9 from my Mac. I also deleted provisioning profiles. I installed Xcode9 only and sync(download) provisioning profiles with Xcode9.

I created .p12 and provisioning profiles with `bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-tools/codesigndoc/master/_scripts/install_wrap.sh)"` and upload this to WORKFLOW | CODESIGNING. (I deleted previous files).

And deleted expired and team provisioning.

Now I got this error message.

> 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

So I open the log and found this.

> Code Signing Error: No profiles for ‘com.surfline.surfapp’ were found: Xcode couldn’t find any iOS App Development provisioning profiles matching ‘com.surfline.surfapp’. 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 \*\*

This is totally wrong because I turned on `Automatically manage singing` from Xcode.

To find a working setting, I turned off the setting and manually set provisioning and identities. I also set `EXPORT_OPTION` from `app-store` to `auto-detect` in WORKFLOW setting.

This setting worked. But I really need to set `Automatically manage signing` on. I’m still digging into this issue.

---

<div class="post-metadata">

**Author:** ![trick14](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/trick14/32/819_2.png) [@trick14](https://discuss.bitrise.io/u/trick14)\
**Post date:** [September 15, 2017, 7:46pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/7 "2017-09-15T19:46:27Z")

</div>

> [@trick14](#):
>
> allowProvisioningUpdates

> <https://stackoverflow.com/questions/44467611/can-xcodebuild-manage-automatic-signing>

---

<div class="post-metadata">

**Author:** ![trick14](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/trick14/32/819_2.png) [@trick14](https://discuss.bitrise.io/u/trick14)\
**Post date:** [September 15, 2017, 7:49pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/8 "2017-09-15T19:49:50Z")

</div>

Can you add `To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild` option when `Automatically manage signing` option is on?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [September 18, 2017, 11:32am UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/9 "2017-09-18T11:32:11Z")

</div>

We’ll check it, but that probably won’t work without providing username & password. We’ll see 😉

---

<div class="post-metadata">

**Author:** ![godreikrisztian](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/godreikrisztian/32/22_2.png) [@godreikrisztian](https://discuss.bitrise.io/u/godreikrisztian)\
**Post date:** [September 18, 2017, 1:42pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/10 "2017-09-18T13:42:04Z")

</div>

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:

> [@trick14](#):
>
> This setting worked. But I really need to set Automatically manage signing on. I’m still digging into this issue.

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_

---

<div class="post-metadata">

**Author:** ![trick14](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/trick14/32/819_2.png) [@trick14](https://discuss.bitrise.io/u/trick14)\
**Post date:** [September 18, 2017, 5:01pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/11 "2017-09-18T17:01:10Z")

</div>

@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

[https://www.bitrise.io/build/82f598d1bc397be4](https://www.bitrise.io/build/82f598d1bc397be4)

---

<div class="post-metadata">

**Author:** ![jeremy.gale](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@jeremy.gale](https://discuss.bitrise.io/u/jeremy.gale)\
**Post date:** [September 18, 2017, 10:19pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/12 "2017-09-18T22:19:46Z")

</div>

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:

```auto
    ▸ 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:

```auto
    ▸ 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!

---

<div class="post-metadata">

**Author:** ![Paul\_Cottrell](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@Paul\_Cottrell](https://discuss.bitrise.io/u/Paul_Cottrell)\
**Post date:** [September 19, 2017, 11:27am UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/13 "2017-09-19T11:27:50Z")

</div>

Same problem here [https://www.bitrise.io/build/afcd2305adb2349f](https://www.bitrise.io/build/afcd2305adb2349f)

---

<div class="post-metadata">

**Author:** ![snnazihn](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@snnazihn](https://discuss.bitrise.io/u/snnazihn)\
**Post date:** [September 20, 2017, 9:00am UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/14 "2017-09-20T09:00:05Z")

</div>

Running into the same issue 😕  
`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](https://www.bitrise.io/build/d2e386c0b3b0c84d)  
Error: `Failed to create target code sign properties mapping, error: failed to run ruby script`

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/daniel/32/20_2.png) [@daniel](https://discuss.bitrise.io/u/daniel)\
**Post date:** [September 20, 2017, 11:14am UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/15 "2017-09-20T11:14:23Z")

</div>

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](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](https://sea2.discourse-cdn.com/flex016/uploads/bitrise/original/1X/0d5663b1a29171cf17d52d5f919cbd7bd37fbb2c.png)

---

<div class="post-metadata">

**Author:** ![godreikrisztian](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/godreikrisztian/32/22_2.png) [@godreikrisztian](https://discuss.bitrise.io/u/godreikrisztian)\
**Post date:** [September 21, 2017, 1:39pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/16 "2017-09-21T13:39:09Z")

</div>

We’ve released a new version ([2.3.1](https://github.com/bitrise-io/steps-xcode-archive/releases/tag/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!

---

<div class="post-metadata">

**Author:** ![jeremy.gale](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@jeremy.gale](https://discuss.bitrise.io/u/jeremy.gale)\
**Post date:** [September 21, 2017, 5:13pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/17 "2017-09-21T17:13:36Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![trick14](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/trick14/32/819_2.png) [@trick14](https://discuss.bitrise.io/u/trick14)\
**Post date:** [September 21, 2017, 6:23pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/18 "2017-09-21T18:23:00Z")

</div>

I still have the same issue.

> [https://www.bitrise.io/build/ce68dd938ddeef51](https://www.bitrise.io/build/ce68dd938ddeef51)

---

<div class="post-metadata">

**Author:** ![jeremy.gale](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@jeremy.gale](https://discuss.bitrise.io/u/jeremy.gale)\
**Post date:** [September 21, 2017, 9:18pm UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/19 "2017-09-21T21:18:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shaddeen](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/shaddeen/32/834_2.png) [@shaddeen](https://discuss.bitrise.io/u/shaddeen)\
**Post date:** [September 22, 2017, 8:54am UTC](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/20 "2017-09-22T08:54:30Z")

</div>

Also seeing issues: [https://www.bitrise.io/build/4cd305a8e4ad378b](https://www.bitrise.io/build/4cd305a8e4ad378b)

[Next page](https://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705.md?page=2)
