XCode 9 archive fails (scheme-target mapping)

Bitrise Build Issue Report template

Description of the issue

Using xcode-archive@2.3.7, get:

Failed to create scheme - target mapping, error: failed to run code signing analyzer script, output: {"error":"scheme does not contain buildable target\n/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__ruby-script-runner__957109157/script.rb:138:in `read_scheme_target_mapping'\n/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/__ruby-script-runner__957109157/script.rb:166:in `<main>'"}, error: exit status 1
Please contact us on bitrise on-site-chat and
attach your failed build url and your project file(s) (.xcworkspace and/or .xcodeproj file(s)),
to let us identify the issue.

Environment:

Where did the issue happen?

xcode-archive@2.3.7 on XCode 9.2 on macOS 10.12

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? NO
  • If you have multiple different build configurations (workflows), does the issue affect all/more than one? : YES
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : Just upgraded to XCode 9

Build log

https://www.bitrise.io/api/build/418acf2081eadd9d/logs.json

Note to all who get the same error: for some reason, the BuildActionEntry in the xcscheme file for that target was missing. A quick toggling of “Build for Archiving” in XCode in the scheme editor regenerated that file with the extra BuildActionEntry added. Weird.