【问题标题】:Update to Alamofire 4.0 and Swift 3.0 via Carthage通过 Carthage 更新到 Alamofire 4.0 和 Swift 3.0
【发布时间】:2017-01-28 08:40:54
【问题描述】:

我正在尝试将 Alamofire 更新到 4.0 版。当我运行 carthage update 时,我在构建 Alamofire 方案时遇到了很多错误。看起来文件没有更新为 Swift 3.0 语法。我做错了什么?从终端登录:

*** Checking out Alamofire at "4.0.0"
*** xcodebuild output can be found in /var/folders/ls/6t_b5mqx5s187hq2dtts6ys00000gn/T/carthage-xcodebuild.ORghi2.log
*** Building scheme "Alamofire watchOS" in Alamofire.xcworkspace
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:36:1: error: expressions are not allowed at the top level
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:36:5: error: consecutive statements on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:74:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:74:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:77:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:77:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:80:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:80:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:83:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:83:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:89:5: error: expected declaration
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:89:9: error: consecutive declarations on a line must be separated by ';'
/Users/liborzapletal/Documents/Aplikace/PNG/PNG/Carthage/Checkouts/Alamofire/Source/NetworkReachabilityManager.swift:92:5: error: expected declaration
....... and many others

我使用的是迦太基 0.18 版。我尝试删除 carthage Build 和 Checkout 文件夹。我已将 Xcode 8 版本设置为默认值。目前没有任何运气。

【问题讨论】:

    标签: alamofire swift3 xcode8 carthage


    【解决方案1】:

    问题是在终端默认Xcode仍然是7。我通过命令检查了它:

    xcodebuild -version
    

    返回:

    Xcode 7.3
    Build version 7D175
    

    在系统中看起来默认是 Xcode 8.0 但不是在终端中。所以我使用命令:

    sudo xcode-select -switch /Applications/Xcode\ 8.app/
    

    现在它开始工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-09
      • 1970-01-01
      • 2017-04-20
      • 2017-06-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多