Ionic iOS 构建失败,找不到错误存档 [英] Ionic iOS build fails, error archive not found
问题描述
我有一个 Ionic 项目.通过 ionic serve
运行给了我预期的结果,没问题.
I have an Ionic project. Running via ionic serve
gives me the result I expect, no problem there.
但是,当运行像 ionic cordova run ios -lc
这样的命令时,我收到一个错误,中断了构建过程.我收到的错误如下:
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:
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
推荐答案
目前cordova-ios与Xcode 10不兼容
Currently cordova-ios is not compatible with Xcode 10
您可以尝试禁用 Xcode 10 使用的新构建系统并通过将其添加到您的 build.json 文件中来使用旧的构建系统
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"
]
或在构建命令中添加--buildFlag="-UseModernBuildSystem=0"
完整的命令应该是 cordova build ios --buildFlag="-UseModernBuildSystem=0"
.
或者对于Ionic ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
这篇关于Ionic iOS 构建失败,找不到错误存档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!