5
votes

I am trying to create an ipa file but I have this unreadable error when I run this command line on my Mac

ionic cordova build ios --prod --release

CordovaError: Promise rejected with non-error: 'Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,MyApp.xcarchive,-exportOptionsPlist,/Users/FSE/myApp04/platforms/ios/exportOptions.plist,-exportPath,/Users/FSE/myApp04/platforms/ios/build/device' at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15) at process.internalTickCallback (internal/process/next_tick.js:77:7)

Ionic:

ionic (Ionic CLI)  : 4.3.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework    : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.2 ([email protected])
Cordova Platforms     : ios 4.5.5
Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 4 other plugins)

System:

ios-deploy : 1.9.4
NodeJS     : v11.0.0 (/usr/local/bin/node)
npm        : 6.4.1
OS         : macOS
Xcode      : Xcode 10.1 Build version 10B61
5
This is related to xcode 10 stackoverflow.com/questions/52385600/…Augustin R
This has been fixed in the latest Cordova iOS release cordova.apache.org/announcements/2019/02/09/…Joe Hakooz

5 Answers

11
votes

I've solved it like this

ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
3
votes

The accepted answer is correct. You can also put in build.json file:

{
    "ios": {
        "release": {
            ...,
            "buildFlag": [
                "-UseModernBuildSystem=0"
            ]
        }
    }
}
2
votes

either

ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0" or just open

xcode -> File -> Workspace Settings

and change build system to "Legacy Build System"

1
votes

In my experience the "buildFlag" is not enough, I mean I had:

"ionic cordova run ios -- --buildFlag=\"-UseModernBuildSystem=0\""

... but I was still getting the Error code 65.

To solve the issue you must open the project you find inside "yourproject/platforms/ios" in xcode and check that the signing certificate is ok. To do so just click on the project (first icon on the top-left panel) and check the "Signing" section.

0
votes

For newer version of xcode, you have to have Legacy Build System. If you already have the Legacy Build System, then uncheck the automatic signing and recheck it. Don't know why but it worked for me.