Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
785 views
in Technique[技术] by (71.8m points)

cordova - Ionic iOS build fails, error archive not found

I have an Ionic project. Running via ionic serve gives me the result I expect, no problem there.

However, when running a command like ionic cordova run ios -lc, I receive an error breaking the build process. The error I receive is the following:

[cordova]  error: archive not found at path '/Users/path-to-app/platforms/ios/demoapp.xcarchive
[cordova]  ** EXPORT FAILED **
[cordova]
[cordova]  (node:5866) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,demoapp.xcarchive,-exportOptionsPlist,/Users/path-to-app/platforms/ios/exportOptions.plist,-exportPath,/Users/path-to-app/platforms/ios/build/device
[cordova]  (node:5866) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`

I see two different errors here: archive not found and a deprecation problem.

I don't know which one is breaking the build, but I can't seem to find a solution for either one of them.

Ionic information:

Ionic:

   ionic (Ionic CLI)  : 4.1.2
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, browser 5.0.4, ios 4.5.5
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   Android SDK Tools : 25.1.7 (/Users/Vincent/Library/Android/sdk)
   ios-deploy        : 1.9.2
   NodeJS            : v9.1.0 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS High Sierra
   Xcode             : Xcode 10.0 Build version 10A255
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Currently cordova-ios is not compatible with Xcode 10

You can try to disable the new build system that Xcode 10 uses and use the old one by adding this to your build.json file

"buildFlag": [
  "-UseModernBuildSystem=0"
]

or adding --buildFlag="-UseModernBuildSystem=0" to the build command

The full command should be cordova build ios --buildFlag="-UseModernBuildSystem=0".

Or for Ionic ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...