首页 > 解决方案 > 由于 swift 版本 3,ionic 4 ios 无法构建

问题描述

升级到 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.

标签: iosionic-frameworkionic4

解决方案


您应该按照以下步骤进行 -

  1. 通过单击平台 >> ios >> PROJECT_NAME.xcworkspace 中的工作区文件在 Xcode 中打开您的项目

  2. 转到构建设置

  3. 现在搜索“Swift 语言版本”

  4. 将版本更改为 4 或 5(视需要而定)

  5. 运行以下命令

    Ionic cordova build ios --buildFlag="-UseModernBuildSystem=0"


推荐阅读