升级到 xcode 10.2 后,我的 ionic for ios 项目停止使用以下命令构建
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
我尝试升级 cordova-ios@5.0.0 并删除并重新添加 ios 平台,但没有成功。
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 4.0, 4.2, 5.0. This setting can be set in the build settings editor.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 12.2'
** ARCHIVE FAILED **
The following build commands failed:
Check dependencies
(1 failure)
xcodebuild: Command failed with exit code 65
[ERROR] An error occurred while running subprocess cordova.
cordova build ios --buildFlag=-UseModernBuildSystem=0 exited with exit code 65.
Re-running this command with the --verbose flag may provide more information.
最佳答案
我遇到了同样的错误。我首先尝试在 Xcode build设置中切换 Swift 语言版本,并很快意识到一些用 Swift 编写的插件坏了。值得庆幸的是,对我来说坏掉的插件是 QR Scanner它得到了很好的维护,并已针对 Swift 5 进行了更新。
所以我修复它的方法是首先运行以下节点命令来查找和更新过时的节点包。
npm outdated
npm update
然后我确定了过时/损坏的 cordova 插件,删除了它们,然后重新安装了最新版本。使用
cordova plugin list
为了确保一切都正确更新,交叉引用插件库的版本号。然后最后我将它添加到 config.xml
<preference name="UseSwiftLanguageVersion" value="5" />
运行时一切构建成功,
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
不幸的是,如果您使用的是用 Swift 编写且维护不善的 cordova 插件,那您就不走运了。如果您有勇气,可以尝试自己更新插件。
希望这对您有所帮助,并且不需要您恢复 Xcode,从而失去为最新版本的 iO 构建的能力。
关于ios - 由于 swift 版本 3,ionic 4 ios 无法构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55381659/