Cordova Phonegap "Export Failed" error code 70 While building ios

Jarrod picture Jarrod · Jan 1, 2017 · Viewed 7.6k times · Source

I am currently using Cordova Phonegap to build an application for iOS. It was working fine, but now I'm getting an error when I'm running cordova build ios in the terminal.

I'm getting the following error:

** EXPORT FAILED **

Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,RoastBot.xcarchive,-exportOptionsPlist,/Users/JarrodMorgan/Desktop/RoastBot/platforms/ios/exportOptions.plist,-exportPath,/Users/JarrodMorgan/Desktop/RoastBot/platforms/ios/build/device

Any help is appreciated!

Answer

Oleksiy Kononenko picture Oleksiy Kononenko · Mar 23, 2018

This is caused by Xcode 9 expecting certain values in exportOptions.plist located in the path that is displayed in the error message. In your case it is ,/Users/JarrodMorgan/Desktop/RoastBot/platforms/ios/exportOptions.plist.

Here is how exportOptions.plist looks for me:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>compileBitcode</key>
    <false/>
    <key>method</key>
    <string>development</string>
    <key>teamID</key>
    <string>TEAM_ID_GOES_HERE</string>
    <key>provisioningProfiles</key>
    <dict>
      <key>YOUR_BUNDLE_ID</key>
      <string>PROVISIONIG_PROFILE_UUID_WOULD_BE_HERE</string>
    </dict>
    <key>signingStyle</key>
    <string>manual</string>
    <key>signingCertificate</key>
    <string>iPhone Developer</string>
  </dict>
</plist>

Double check that you have provisioningProfiles and signingStyle values in your exportOptions.plist if you don't then you probably have cordova-ios version prior to 4.5.2. This was fixed and released in cordova-ios 4.5.2 please see this PR

In order for your to resolve this error update your cordova-ios to 4.5.2 or later, drop your plugins and platforms and re-add them.

However in my case after upgrading to cordova-ios 4.5.4 I started to see following error:

ld: 270 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It turns out that that was caused by the fact that cordova built cordova-plugin-console into its core and if you have that plugin in your project than you might get the above error. Simply remove cordova-plugin-console and this error will go away. Here is what it says on console plugin's github page:

This plugin is no longer being worked on as the functionality provided by this plugin is now included in cordova-ios 4.5.0 or greater, and support is already built in to cordova-windows > 5.0.0. You should remove this plugin from your applications.

Here is the link to the docs.