xcodebuild -exportArchive fails with error Locating signing assets failed

Vladimir Grigorov picture Vladimir Grigorov · Jul 17, 2017 · Viewed 9.5k times · Source

I'm using command line xcodebuild tool to export .ipa files from Xcode archives. It was working fine up to Xcode 8.3.3. The same setup has stopped working with Xcode 9 beta. Now it fails with this error:

IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fc309310550>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed."

It seems Xcode 9 cannot locate the provisioning profiles, but why?

Answer

Anton Ogarkov picture Anton Ogarkov · Sep 28, 2017

In my case the issue was solved by the next fields in the -exportOptionsPlist plist:

<dict>
  <key>compileBitcode</key>
  <false/>

  <key>method</key>
  <string>ad-hoc</string>

  <key>provisioningProfiles</key>
  <dict>
      <key>com.my.bundle.id</key>
      <string>AD_HOC_PROVISIONING_PROFILE_NAME</string>
  </dict>

  <key>signingCertificate</key>
  <string>CERTIFICATE_HASH</string>

  <key>signingStyle</key>
  <string>manual</string>

  <key>teamID</key>
  <string>TEAM_ID</string> 
</dict>

So, apparently I had to set: compileBitcode, method, provisioningProfiles, signingCertificate, signingStyle and teamID.

In your case the set of fields can be different. I have found out my set by archiving and exporting the .ipa through Xcode 9. Xcode will export its exportOptionsPlist with the ipa and show what fields it used.

More info on the fields discovery: https://blog.bitrise.io/new-export-options-plist-in-xcode-9