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

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. : 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

Comments

I’ve tried

https://blog.bitrise.io/new-export-options-plist-in-xcode-9

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)

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) 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…

1 Like

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?

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: 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.

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

These steps can work together perfectly, in short the Cert and Profile installer step downloads & installs the files you upload to 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!

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:

    <?xml version="1.0" encoding="UTF-8"?> compileBitcode iCloudContainerEnvironment Production method ad-hoc provisioningProfiles myapp.bundle.id Bitrise ad-hoc - (myapp.bundle.id) signingCertificate iPhone Distribution signingStyle manual stripSwiftSymbols teamID XXXX thinning <none>
  4. Replace the element with the “Bitrise $DISTRIBUTION_TYPE - ($BUNDLE_ID)” profile name.

This solution worked for me.

Awesome!! :tada: :slight_smile:

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), 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! :wink:

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! :slight_smile:

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! :slight_smile:

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).
2 Likes

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

Good point, noted!

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.

I think we already do - all other options listed before the Contact Support option are links to the relevant part of discuss.bitrise.io

02

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

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 :wink: