Upgrade to Alamofire 4.0 and Swift 3.0 via Carthage

I am trying to upgrade Alamofire to version 4.0. When I run the Carthage update, I get a lot of errors when building the Alamofire schema. It seems that the files were not updated to the Swift 3.0 syntax. What am I doing wrong? Login from the terminal:

*** 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 

I am using carthage version 0.18. I tried to delete the Carthage Build and Checkout folders. I installed the default version of Xcode 8. So far, no luck.

+1
source share
1 answer

The problem was that in the default terminal Xcode remained 7. I checked it with the command:

 xcodebuild -version 

which returns:

 Xcode 7.3 Build version 7D175 

On the system, this looks like the default Xcode 8.0, but not in the terminal. Therefore, I use the command:

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

And now it works.

0
source

All Articles