Cordova Phonegap “Export Failed” error code 70 While building ios

淺唱寂寞╮ 提交于 2019-12-23 06:54:51

问题


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!


回答1:


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.




回答2:


You can solve this problem by returning to the old PhoneGap version. Add this to your config.xml file

<preference name="phonegap-version" value="cli-6.3.1" />


来源:https://stackoverflow.com/questions/41412808/cordova-phonegap-export-failed-error-code-70-while-building-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!