Export fails with Xcode3Core crash

Description of the issue

I’m trying to configure build & deploy of my iOS app. Archiving succeeds, then export fails with signal: error trap. Please scroll to the bottom of my topic, where I attached the log, it’s content is quite important in this case.

Environment:

Bitrise.io: Xcode 9.1.x, on macOS 10.12 (Sierra)
Xcode Archive & Export for iOS version 2.4.4

Reproducibility

  • Does a “Rebuild” help? : NO
  • Does a rebuild without caches help? : NO
  • Does the issue happen sporadically, or every time? : EVERY TIME
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : TODAY (so from the beginning - I was adding this step today)

Local reproduction

Can it be reproduced on your own Mac/PC by following our local debug guide? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what bitrise.io will get when it does a git clone in the clean environment! If possible please note which sections you tried.
Followed the first section, it’s not reproducible on my computer.
I’m able to run, archive and export this code on 3 macs + jenkins based CI. Didn’t see the problem anywhere and it rather looks like there is something invalid with the step (or provisioning profiles but looking at the build log I doubt that’s the issue).

Build log

Probably the most important is output from raw-xcodebuild-output.log:

** INTERNAL ERROR: Uncaught exception **
Uncaught Exception: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]
Stack:
  0   __exceptionPreprocess (in CoreFoundation)
  1   objc_exception_throw (in libobjc.A.dylib)
  2   -[__NSPlaceholderArray initWithObjects:count:] (in CoreFoundation)
  3   +[NSArray arrayWithObjects:count:] (in CoreFoundation)
  4   __55-[Xcode3CommandLineBuildTool _distributeArchiveAndExit]_block_invoke (in Xcode3Core)
  5   -[Xcode3CommandLineBuildTool _distributeArchiveAndExit] (in Xcode3Core)
  6   -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
  7  0x00000001063512af (in xcodebuild)
  8   start (in libdyld.dylib)

Additional notes: Because for the first glance it seems to be some kind of bug in the step (I’m not sure) I’ve also filled the issue in your github page: https://github.com/bitrise-io/steps-xcode-archive/issues/100. If the step is not an issue reason I’ll obviously remove that.

1 Like

Hi @NataliaOsiecka,

Thanks for reporting this here!

The exception is an Xcode internal exception, not related to the code signing files or bitrise tools directly. That said the Xcode crash happens because an invalid “export options” plist file.

So, after checking your config it seems that you tried to specify an export options plist file path (adhoc-export.plist) but you specified as the content for the Xcode Archive step.

This means that Xcode Archive will write the text adhoc-export.plist into a export_options.plist and pass that to Xcode as the “Export Options Plist” parameter (from the log: xcodebuild "-exportArchive" ... "-exportOptionsPlist" "/Users/vagrant/deploy/export_options.plist").

Why Xcode can’t handle this and print any error message, but instead it just crashes… That’s another question :slight_smile:

The solution is: provide the actual content (most likely the one you have in the adhoc-export.plist file) as the content/text for that input. Not the file path but the file’s content!

That should fix the issue :slight_smile:

If you’d have any questions just let us know!

Thank you - that solved my issue. Seems I didn’t notice that it says “content” instead of “path”. Pity there is no more verbose warning, but I understand it’s on the Xcode side and you can’t interfere with that.

1 Like

Glad to hear it helped! :slight_smile:

I created a card in our issue tracker to discuss with our team how we could help. If nothing else we could just validate that the content is indeed a plist content and not a path/string (not a plist).

1 Like