5

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 (cordova-lib@8.1.1)
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
idan gal
  • 79
  • 5
Gelso77
  • 1,763
  • 6
  • 30
  • 47
  • This is related to xcode 10 https://stackoverflow.com/questions/52385600/ionic-ios-build-fails-error-archive-not-found/52388081 – Augustin R Nov 04 '18 at 18:53
  • This has been fixed in the latest Cordova iOS release https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html – Joe Hakooz Feb 16 '19 at 18:13

5 Answers5

11

I've solved it like this

ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Gelso77
  • 1,763
  • 6
  • 30
  • 47
  • Tried this but still having the same error. – Anirban Das Jun 25 '22 at 08:03
  • This is my system info Ionic: Ionic CLI : 5.4.16 Ionic Framework : ionic-angular 3.9.10 @ionic/app-scripts : 3.2.4 Cordova: Cordova CLI : 8.1.1 (cordova-lib@8.1.0) Cordova Platforms : ios 4.4.0 Cordova Plugins : no whitelisted plugins (31 plugins total) Utility: cordova-res : not installed native-run : 1.6.0 System: NodeJS : v12.22.12 (/Users/aeologic/.nvm/versions/node/v12.22.12/bin/node) npm : 6.14.16 OS : macOS Monterey Xcode : Xcode 13.4.1 Build version 13F100 – Anirban Das Jun 25 '22 at 08:03
3

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

{
    "ios": {
        "release": {
            ...,
            "buildFlag": [
                "-UseModernBuildSystem=0"
            ]
        }
    }
}
Niels Steenbeek
  • 4,692
  • 2
  • 41
  • 50
2

either

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

xcode -> File -> Workspace Settings

and change build system to "Legacy Build System"

Meshal Alhazmi
  • 346
  • 1
  • 2
  • 11
1

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.

Marco C.
  • 1,282
  • 2
  • 15
  • 19
0

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.

Amrit Subedi
  • 431
  • 3
  • 11