【问题标题】:SwiftLint: Could not cast value of type 'Swift.Int64' to 'Swift.String', Build SwiftLintSwiftLint:无法将“Swift.Int64”类型的值转换为“Swift.String”,构建 SwiftLint
【发布时间】:2018-11-22 06:44:27
【问题描述】:

我正在将 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 为什么会这样?

【问题讨论】:

    标签: ios cocoapods swift4 xcode9 swiftlint


    【解决方案1】:

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

    在撰写本文时,最新版本是0.25.1

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

    查看您正在运行的版本:swiftlint version

    SwiftLint 不是通过 CocoaPods 安装的!

    要升级到最新版本:

    • 删除 SwiftLint:brew uninstall swiftlint

    • 安装 SwiftLint:brew install swiftlint

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-19
      • 1970-01-01
      • 2018-01-03
      • 2017-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-10
      相关资源
      最近更新 更多