swift - Ubuntu 16.04 上的错误 : cannot convert value of type 'ObjCBool' to expected argument type 'Bool' on Swift 4. 1.2 和 Kitura

标签 swift ubuntu kitura

我有一个普通的 Ubuntu 16.04,并在上面安装了 OpenSSH、Curl 和 Swift 4.1.2。 基本示例(swift package init --type executable)可以工作,但是当我想使用 Kitura 框架时,如果我“快速构建”它,则会出现编译错误。

错误:

/.build/checkouts/Kitura.git--4845395383860597130/Sources/Kitura/staticFileServer/FileServer.swift:138:21: error: cannot convert value of type 'ObjCBool' to expected argument type 'Bool'
            if !isDirectoryBool {
                ^~~~~~~~~~~~~~~

错误:终止(1):/home/thewall/swift-4.1.2-RELEASE-ubuntu16.04/usr/bin/swift-build-tool -f/home/thewall/zSwift/.build/debug。 yaml 主要输出:

我的 package.swift 文件如下所示:

import PackageDescription

let package = Package( name: "zSwift", dependencies: [ .package(url: "https://github.com/IBM-Swift/Kitura.git", >.upToNextMinor(from: "2.1.0")), ], targets: [ .target( name: "zSwift", dependencies: ["Kitura"]), ] )

uname -a 给出:

Linux thewall 4.10.0-28-generic#32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

有什么想法吗?

最佳答案

Kitura 正在正确处理它,请参阅 https://github.com/IBM-Swift/Kitura/blob/master/Sources/Kitura/staticFileServer/FileServer.swift#L95

但是,您使用的是未针对您的 Swift 版本更新的过时 Kitura 版本。请将 Kitura 更新到最新版本,目前是 2.4.1。

关于swift - Ubuntu 16.04 上的错误 : cannot convert value of type 'ObjCBool' to expected argument type 'Bool' on Swift 4. 1.2 和 Kitura,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51026789/

相关文章:

ios - 无法让 SKActionmove 可靠地工作

ubuntu - 在 ubuntu 12.04 服务器上安全备份 sqlite3 数据库的脚本

c++ - 以编程方式创建终端命令?

linux - httpAdditionalHeaders 不适用于 Linux

ios - 每次 .insert() 或 .remove(at :) are called) 在 UserDefaults 中保存更新的 Set

swift - 如何设置选择分段 Controller 中的哪个分段

ios - Swift Combine compactMap 不起作用(Xcode 13)

java - Ubuntu 终端中的 "insufficient memory for Java Runtime Environment to continue"

swift - 如何使用 Kitura 设置 StaticFileServer()?

docker - Docker Build Kitura Sqift容器-找不到Shim.h mysql.h文件