SwiftLint:无法转换类型' Swift.Int64' to' Swift.String',Build SwiftLint

时间:2018-06-12 19:25:14

标签: ios cocoapods swift4 xcode9 swiftlint

我正在将Swiftlint与我在Xcode 9,Swift 4中的项目集成。

我用Cocoapods安装了swiftlint。我的Podfile如下所示:

# Uncomment the next line to define a global platform for your project
 platform :ios, '10.0'

target 'my_target' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!

    # Pods for my_target

    # https://github.com/Alamofire/Alamofire
    pod 'Alamofire'

    # https://fabric.io/kits/ios
    pod 'Fabric'

    # https://github.com/realm/SwiftLint
    pod 'SwiftLint'

end

尝试构建项目时,我看到了这个错误:

  

无法转换类型' Swift.Int64' (0x10ff35f80)到   ' Swift.String' (0x10ff3c4d8)。

pods中安装的版本是0.25.1 为什么会这样?

1 个答案:

答案 0 :(得分:0)

很可能你使用的是SwiftLint的错误版本。

在撰写本文时,最新版本为swiftlint version

您可以在此处查看最新版本: https://github.com/realm/SwiftLint/releases

要查看您正在运行的版本:brew uninstall swiftlint

未通过CocoaPods安装SwiftLint!

要升级到最新版本:

  • 删除SwiftLint:brew install swiftlint

  • 安装SwiftLint:{{1}}