title: IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7f961e5d0d70>: Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
body: <p>I inherited an application that I first build from the command line => npm run build.  Part of the process that is run as a result is the following functions.</p>
  
  <pre><code>function archive(options) {
    const proc = spawn('xcrun', [
      'xcodebuild',
      'archive',
      '-project',
      options.projectPath,
      '-scheme',
      options.scheme,
      '-archivePath',
      options.archivePath
    ], {
      stdio: 'inherit'
    });
    proc.on('close', (code) =&gt; {
      if (code !== 0) exit(code, 'Archive failed.');
      exportArchive(options);
    });
  }
  
  function exportArchive(options) {
    const proc = spawn('xcrun', [
      'xcodebuild',
      '-exportArchive',
      '-archivePath',
      options.archivePath,
      '-exportPath',
      options.exportPath,
      '-exportOptionsPlist',
      options.plistPath
    ], {
      stdio: 'inherit'
    });
    proc.on('close', (code) =&gt; {
      if (code !== 0) exit(code, 'Export archive failed.');
      rename(options);
    });
  } 
  </code></pre>
  
  <p>After this is completed, I open the Xcode project, select proper Team, and then perform Product\Archive. This then generates my .ipa.</p>
  
  <p>This morning when performing the first step (npm run build) from the command line I got the following error:
   
  ** ARCHIVE SUCCEEDED **
  2016-10-28 10:13:53.144 xcodebuild[4199:50183] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/1k/dwr2csfs5lnfrs7xq7520v_w0000gq/T/xxxxx xxxxx_2016-10-28_10-13-53.144.xcdistributionlogs'.
  2016-10-28 10:13:53.590 xcodebuild[4199:50183] [MT] I<strong>DEDistribution: Step failed: : Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
  error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 1.)
  Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
  ** EXPORT FAILED **
  Export archive failed.</strong></p>
  
  <p> 
  Looking in Keychain Access I see that my "Apple Worldwide Developer Relations Certification Authority" certificate does not expire until 2023.
   
  I do see a local distribution certificate that expired yesterday.
   
  Am I getting this error because this expired distribution certificate is pointing to the "Apple Worldwide Developer Relations Certification Authority" certificate per this thread?
  <a href="https://forums.developer.apple.com/thread/38472" rel="nofollow">https://forums.developer.apple.com/thread/38472</a></p>
  
  <p> I removed the expired distribution certificate in Keychain Access (I have another valid distribution certificate). I then tried to build again from the command line and still get the same error.</p>
  
  <p> 
  ** ARCHIVE SUCCEEDED **
  2016-10-28 11:31:14.735 xcodebuild[5202:74254] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/1k/dwr2csfs5lnfrs7xq7520v_w0000gq/T/xxxxx xxxxx_2016-10-28_11-31-14.734.xcdistributionlogs'.
  2016-10-28 11:31:15.087 xcodebuild[5202:74254] [MT] ****IDEDistribution: Step failed: : Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
  error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 1.)
  Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
  ** EXPORT FAILED ******</p>
  
  <p>Even with this error, I can still go into Xcode, select the proper Team, then proceed with the Product\Archive to complete the build of the application.
   </p>