# Code signing issues with Xcode 9.2 using iOS Auto Provision (0.9.7) and Xcode Archive (2.4.5)

**URL:** <https://discuss.bitrise.io/t/code-signing-issues-with-xcode-9-2-using-ios-auto-provision-0-9-7-and-xcode-archive-2-4-5/4047>\
**Category:** Builds\
**Created:** [February 6, 2018, 11:40am UTC](https://discuss.bitrise.io/t/code-signing-issues-with-xcode-9-2-using-ios-auto-provision-0-9-7-and-xcode-archive-2-4-5/4047 "2018-02-06T11:40:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jync](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jync/32/1189_2.png) [@jync](https://discuss.bitrise.io/u/jync)\
**Post date:** [February 6, 2018, 11:40am UTC](https://discuss.bitrise.io/t/code-signing-issues-with-xcode-9-2-using-ios-auto-provision-0-9-7-and-xcode-archive-2-4-5/4047/1 "2018-02-06T11:40:29Z")

</div>

## Description of the issue

- Each time it builds, I get the following error Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 “Locating signing assets failed.”

## Environment:

Hybrid (Xamarin, Ionic, …) on macOS, includes Visual Studio for Mac, Stable channel

**Which build Step causes the issue and which version of the step?**

Xcode Archive (2.4.5)

## Reproducibility

- _Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build)_ : NO
- _Does a rebuild without caches help? (You can remove the `Cache:Pull` and `Cache:Push` steps temporarily to not to use the cache, or [you can delete all the caches on the `Settings` tab of the app](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)._ : NO
- _Does the issue happen sporadically, or every time?_ : YES
- _Does upgrading the build Step to the latest version help?_ : NO
- _When did the issue start?_ : TODAY

### Local reproduction

NO

## Build log

> **[Log in - Bitrise](https://app.bitrise.io/users/sign_in)**
>
> Bringing back the joy of iOS & Android development through automating build, testing and support cycles.

### Comments

I’ve tried

> **[New export options Plist in Xcode 9 - Bitrise Blog](https://bitrise.io/blog/post/new-export-options-plist-in-xcode-9)**
>
> Even if Xcode 9 is still in beta, Bitrise already has an Xcode 9 stack, which is used by many of you in experimenting mood. 👨‍🔬

I’ve selected manual and automatic code signing when exporting and setting that as the exportOptions but nothing seems to work. If manual, the error says it can’t find the cert. If automatic, I get the error above. It looks like you need to support the -allowProvisioningUpdate flag as the fast lane guys have discovered ([xcode 9 beta export options not working · Issue #9589 · fastlane/fastlane · GitHub](https://github.com/fastlane/fastlane/issues/9589))

Could your blog articles go into more detail? What would the plist file look like? What should one select? The documentation in this area is woefully inadequate and give the issues others are having ([Xcode 9 GM - Failed to create target code sign properties mapping, error - #45 by viktorbenei](http://discuss.bitrise.io/t/xcode-9-gm-failed-to-create-target-code-sign-properties-mapping-error/2705/45)) and the fag that Xcode 9 has been out for a while… we need greater guidance and clarity how to get builds working in bitrise.

Please help…

---

<div class="post-metadata">

**Author:** ![jync](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jync/32/1189_2.png) [@jync](https://discuss.bitrise.io/u/jync)\
**Post date:** [February 6, 2018, 11:44am UTC](https://discuss.bitrise.io/t/code-signing-issues-with-xcode-9-2-using-ios-auto-provision-0-9-7-and-xcode-archive-2-4-5/4047/2 "2018-02-06T11:44:01Z")

</div>

There’s also a lot of confusion around using iOS Auto Provision (not sure how it helped because I had to generate AdHoc and Distribution certs and to upload them to bitrise), and how that may or may not be compatible with the Certificate and Profile Installer. Are they mutually exclusive or is the auto provision an additional step?

---

<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:** [February 6, 2018, 12:50pm UTC](https://discuss.bitrise.io/t/code-signing-issues-with-xcode-9-2-using-ios-auto-provision-0-9-7-and-xcode-archive-2-4-5/4047/3 "2018-02-06T12:50:15Z")

</div>

Thanks for reporting @jync, we’ll look into it ASAP!

In the meantime, if iOS Auto Provision doesn’t work you can use our `codesigndoc` tool to collect the required signing files, simply run it on your own Mac (where you can Archive in Xcode / where you have all the required files) and upload all the files it collects: [iOS code signing - Bitrise Docs](http://devcenter.bitrise.io/ios/code-signing/#collect-the-required-files-with-codesigndoc)

No need to delete any of the steps, the two solutions can work together.

> [@jync](#):
>
> It looks like you need to support the -allowProvisioningUpdate flag

That’s not required, if all the required signing files are present.

> [@jync](#):
>
> There’s also a lot of confusion around using iOS Auto Provision (not sure how it helped because I had to generate AdHoc and Distribution certs and to upload them to bitrise), and how that may or may not be compatible with the Certificate and Profile Installer. Are they mutually exclusive or is the auto provision an additional step?

These steps can work together perfectly, in short the Cert and Profile installer step downloads & installs the files you upload to [bitrise.io](http://bitrise.io) while the iOS Auto Provision step checks the files and tries to generate all the missing ones. A Certificate with private key (.p12) is still required even for the iOS Auto Provision step, as the private key for distribution can’t be generated without overwriting an existing one.

If running `codesigndoc` and uploading all the files it collects would not solve the issue can you please contact our support via the onsite chat and ask for Viktor? I’d be happy to look into your config, if possible enable Support Access on the Settings tab of the app to grant us access to the configs!

---

<div class="post-metadata">

**Author:** ![jync](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jync/32/1189_2.png) [@jync](https://discuss.bitrise.io/u/jync)\
**Post date:** [February 6, 2018, 1:03pm UTC](https://discuss.bitrise.io/t/code-signing-issues-with-xcode-9-2-using-ios-auto-provision-0-9-7-and-xcode-archive-2-4-5/4047/4 "2018-02-06T13:03:15Z")

</div>

Hi @viktorbenei… Thanks for the reply. You beat the Intercom support guys again.

The documentation in this area is super confusing. Why does the blog article say to replace the Cert and Profile installer step with the Auto Provision step?

Just as I was typing, I FINALLY… I got it working… (after wasting 8+ hrs on it)

You might want to advise other users that this is the way to fix it…

1. When you select iOS Auto Provision, you need to take note of the “Ensure App IDs and Provision Profiles on Developer Portal” step. It looks like the Auto Provision step is downloading and installing provisioning profiles named in the following manner “Bitrise $DISTRIBUTION\_TYPE - ($BUNDLE\_ID)”

2. You must use export options and select “Manually Manage Code Signing”

3. This generates an export option file that looks like this:

4. Replace the element with the “Bitrise $DISTRIBUTION\_TYPE - ($BUNDLE\_ID)” profile name.

This solution worked for me.

---

<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:** [February 6, 2018, 1:10pm UTC](https://discuss.bitrise.io/t/code-signing-issues-with-xcode-9-2-using-ios-auto-provision-0-9-7-and-xcode-archive-2-4-5/4047/5 "2018-02-06T13:10:38Z")

</div>

> [@jync](#):
>
> Just as I was typing, I FINALLY… I got it working… (after wasting 8+ hrs on it)

Awesome!! 🎉 🙂

> [@jync](#):
>
> Why does the blog article say to replace the Cert and Profile installer step with the Auto Provision step?

Well, technically that’s not an issue if you replace the steps as the iOS Auto Provision step can also download the initial set of files (the ones you uploaded to [bitrise.io](http://bitrise.io)), but including both in the workflow works perfectly as well.

I believe the blog post was written that way as that’s the _optimal_ setup (optimal as in minimal and sufficient) and to indicate where the new step should be added (e.g. we saw configurations where the Deploy step was before any archive and so the archived app/artifacts were not deployed).

That said this is definitely a great point, I’ll bring this up for a discussion with the team! 😉

> [@jync](#):
>
> This solution worked for me.

Thanks for reporting the step by step solution! I’m sure it’ll help others, and we’ll also discuss how we could make this better / easier! 🙂

---

<div class="post-metadata">

**Author:** ![jync](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/jync/32/1189_2.png) [@jync](https://discuss.bitrise.io/u/jync)\
**Post date:** [February 6, 2018, 10:09pm UTC](https://discuss.bitrise.io/t/code-signing-issues-with-xcode-9-2-using-ios-auto-provision-0-9-7-and-xcode-archive-2-4-5/4047/6 "2018-02-06T22:09:17Z")

</div>

> Thanks for reporting the step by step solution! I’m sure it’ll help others, and we’ll also discuss how we could make this better / easier! 🙂

No worries. Here’s what I think would help immensely…

1. Not to rely on blog posts to document what to do. Over time this becomes hard to tell if it is relevant and it is particularly confusing when another post tells you to do something else
2. Don’t tell users to remove something when it isn’t necessary
3. Have a proper knowledge base area that is the definitive source of truth and get your blog posts to point to that.
4. If a blog post has out of date material, update it to indicate it is out of date.
5. Definitively explain what to do in your knowledge base, including proper examples
6. Remove your intercom button if your intercom team isn’t planning to respond to questions in real-time and direct them to post a build issues discussion (as you have asked many other users to do so).

---

<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:** [February 8, 2018, 5:54pm UTC](https://discuss.bitrise.io/t/code-signing-issues-with-xcode-9-2-using-ios-auto-provision-0-9-7-and-xcode-archive-2-4-5/4047/7 "2018-02-08T17:54:28Z")

</div>

> [@jync](#):
>
> Not to rely on blog posts to document what to do. Over time this becomes hard to tell if it is relevant and it is particularly confusing when another post tells you to do something else

Got it, DevCenter article is scheduled as well as some UX revisions to make the setup of iOS Auto Provision easier 😉

> [@jync](#):
>
> Don’t tell users to remove something when it isn’t necessary

Good point, noted!

> [@jync](#):
>
> Remove your intercom button if your intercom team isn’t planning to respond to questions in real-time and direct them to post a build issues discussion (as you have asked many other users to do so).

We’re working on improving the response time there. I see your point but it’s important to note that due the certain events (_cough_ Apple acquiring Buddybuild _cough_) in the last month we have to deal with significantly more support tickets. We’re working on improving the response times especially for those users who belong to a paid account.

> [@jync](#):
>
> and direct them to post a build issues discussion (as you have asked many other users to do so).

I think we already do - all other options listed before the _Contact Support_ option are links to the relevant part of [discuss.bitrise.io](http://discuss.bitrise.io)

![02](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/3/3e153cb2ad5a788297cc2d22a994908df0765794.png)

Additionally every failed build page includes a **Can’t figure out what caused this error? Report it here.** notice right under the log which points to [discuss.bitrise.io](http://discuss.bitrise.io)

I might have misunderstood you - could you please share a bit more info, where we should change something?

Ohh and of course thanks for your feedback! Really, honest feedback helps **a lot**! I created quite a few cards in our internal tracker for a discussion with the team 😉
