gpt4 book ai didi

Alamofire 构建失败,出现 138 个错误

转载 作者:行者123 更新时间:2023-12-04 12:18:57 25 4
gpt4 key购买 nike

我刚刚将 Alamofire 导入到 Swift 项目中(通过 cocoapods),但由于 Alamofire,我的构建失败了。 XCode 说 Alamofire 有 138 个错误。

这里仅选取了一个错误(在 Alamofire.swift 文件中给出)。
可选类型字符串的值未解包:

extension NSURL: URLStringConvertible {

public var URLString: String {

return absoluteString // error shows here

}

}

大多数错误是“快速编译器错误”

我尝试了以下方法:
  • 关闭和重新打开 XCode
  • pod 删除 repo master/pod 设置/pod 安装
  • rm -rf MyProject.xcworkspace/pod 安装

  • 但到目前为止还没有成功。

    我正在运行最新的 cocoapods 预发布版 (0.39.0.beta.4) 和 XCode 6.4

    有什么建议 ?

    最佳答案

    好吧,您使用的是 Xcode 6.4,它使用 Swift 1.2

    由于 Alamofire 的 master 分支现在使用 Swift 2.0,因此您需要更新到 Xcode 7

    或者,您可以在 podfile 中提供版本“1.3.1”,因为这是使用 Swift 1.2 的最后一个版本。

    关于Alamofire 构建失败,出现 138 个错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32588531/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com