EXPORT FAILED on iOS build after update to Ionic 3

I updated to Ionic 3 but I’m having problem to build to iOS.
When I run: cordova build ios I receive this error:

Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,Test.xcarchive,-exportOptionsPlist,/apps/test-app/platforms/ios/exportOptions.plist,-exportPath,/apps/test-app/platforms/ios/build/device

Someone had this issue after updating? How can I solve this?

Thank you!

What exactly and how did you update?
Can you please post the complete error message, all the output you get after running the command?
Please also include your ionic info output.

I follow this guide to update:
https://forum.ionicframework.com/t/guide-how-to-update-to-ionic-3-x/87516

Then I had to run those commands:
sudo npm uninstall -g @angular/cli sudo npm cache clean sudo npm install -g @angular/cli@latest sudo npm install -g typescript@latest

I can run on browser and Android perfectly. Only on iOS I’m having problem.

When I run the command the build appear to be ok. But this is the end of output:

** ARCHIVE SUCCEEDED **

2017-05-23 11:35:14.469 xcodebuild[13461:72573] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/nh/t592403s3l992dzy4rpygkr80000gn/T/Test_2017-05-23_11-35-14.467.xcdistributionlogs'.
2017-05-23 11:35:14.510 xcodebuild[13461:72573] [MT] DeveloperPortal: Using pre-existing current store at URL (file:///Users/diego/Library/Developer/Xcode/DeveloperPortal%207.3.1.db).
2017-05-23 11:35:15.087 xcodebuild[13461:72573] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7fe662c9f8d0>: 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 **

Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,Test.xcarchive,-exportOptionsPlist,/apps/test-app/platforms/ios/exportOptions.plist,-exportPath,/apps/test-app/platforms/ios/build/device
global packages:

    @ionic/cli-utils : 1.1.2
    Cordova CLI      : 6.5.0 
    Ionic CLI        : 3.1.2

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.1.2
    @ionic/cli-plugin-ionic-angular : 1.1.2
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v7.10.0
    OS         : OS X El Capitan
    Xcode      : Xcode 7.3.1 Build version 7D1014 
    ios-deploy : 1.9.1 
    ios-sim    : not installed

Thank you

Both errors (you only posted the last one in your first post) turned up several times here in the forum in the last few days, mostly in connection to ionic package. Problem: There was no real solution :confused:

Ionic package release error for ios building
Error in Ionic package, Error Code 70

Please try to remove the ios platform and re-add it and try to build it again.

Hey there,

is there any news on this? I’m getting the same error.
ionic serve --lab went fine. But both ionic cordova build ios --dev and --prod throw this error:

...
** ARCHIVE SUCCEEDED **

2017-08-30 20:51:15.679 xcodebuild[85015:3682969] [MT] IDEDistribution: -[IDEDistributionLogging 
_createLoggingBundleAtPath:]: Created bundle at path 
'/var/folders/92/wg4qbdbd26q053r3_9lz3p1c0000gp/T/Plopp_2017-08-30_20-51-15.678.xcdistributionlogs'.
2017-08-30 20:51:15.952 xcodebuild[85015:3682969] [MT] IDEDistribution: Step failed: 
<IDEDistributionSigningAssetsStep: 0x7ffc6f13af70>: Error Domain=IDEDistributionErrorDomain Code=1 "The 
operation couldn’t be completed. (IDEDistributionErrorDomain error 1.)"
error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 1.)

Error Domain=IDEDistributionErrorDomain Code=1 "The operation couldn’t be completed. (IDEDistributionErrorDomain 
error 1.)"

** EXPORT FAILED **

Error: Error code 70 for command: xcodebuild with args: 
-exportArchive,-archivePath,Plopp.xcarchive,-exportOptionsPlist,/Users/XYZ/Sites/playground/flensperiment/platforms/ios/exportOptions.plist,-exportPath,/Users/XYZ/Sites/playground/flensperiment/platforms/ios/build/device

I have a paid Developer Account for iOS Apps and I use XCode 7.1 (with my own account as “Team”) and "cordova-ios": "^4.4.0".
My system info:

"Ionic Framework: 3.6.0",
"Ionic App Scripts: 2.1.3",
"Angular Core: 4.1.3",
"Angular Compiler CLI: 4.1.3",
"Node: 8.2.1",
"OS Platform: OS X Yosemite"

Any possible solution?

Unfortunately not…

I kept my app over Ionic 2 because I had no time to solve this.
My next app version will be completely native. Ionic is making a good job, but I think they are doing drastic changes that we need to spend a lot of time to follow up.

I hope you can solve this!!

I would remove the ios platform and re-add it as a first step.

@Sujan12 I think I tried that but maybe I did it wrong.
What exactly does it mean to remove the ios platform (besides deleting the corresponding folder from /platforms? Is there anything else to do? Like running some command after deleting the folder?

Run ionic cordova platfom remove ios and then ionic ordova platform add ios.
But deleting the folder directly has similar effects - the folder being generated again from nothing.

If I had this error, I would try to investigate what this IDEDistributionthing is mentinoed in the error message.

1 Like

@Sujan12 Ok, thanks so far. I’ll give it a try and research a bit more for this IDEDistribution. I’ll get back here to tell whether that led to something or not.

1 Like

@Sujan12 Wow! Thanks. That solved it, actually.
For the record:

ionic cordova platform remove ios
ionic cordova platform add ios
ionic cordova build ios --prod

worked perfectly.

Thanks again!

1 Like

in my case, this command work great and produce for me an IPA

ionic cordova build --prod --device ios

just dont use “–release” attr because it will fail when signing.