ios - 由于 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.
解决方案
您应该按照以下步骤进行 -
通过单击平台 >> ios >> PROJECT_NAME.xcworkspace 中的工作区文件在 Xcode 中打开您的项目
转到构建设置
现在搜索“Swift 语言版本”
将版本更改为 4 或 5(视需要而定)
运行以下命令
Ionic cordova build ios --buildFlag="-UseModernBuildSystem=0"
推荐阅读
- ios - iOS 15 beta 6 标签栏问题
- scala - 如何在运行时使用 ScalaPB 在 Spark 上一般解压缩 google.protobuf.Any?
- firebase - 如何在 react native expo cli 功能组件中使用 AsyncStorage
- laravel - 如何在唯一注册 URL 示例中使用 SignedRoute
- python - 如何编写将标签转换为秒的函数?
- javascript - 使用 react 渲染书架
- android - Jetpack Compose - 我的 Text() 中的版式自定义不受影响
- javascript - 将对象数组聚合成一个对象
- android - handshakeexception 客户端中的握手错误(os error wrong_version_number tls_record cc 242) Flutter 应用程序/节点服务器
- javascript - TypeError:a.preventDefault 不是函数