我安装了2个Xcode版本,即8.3.2和8.2.1。
我正在开发一个用Swift 2编写的项目,该项目通过Carthage安装了一些第三方的。
拉分支后,我做了carthage update
:然后我得到了这个错误:
$ carthage update
*** Fetching SwiftyJSON
*** Fetching Alamofire
*** Fetching Reachability.swift
*** Fetching AlamofireImage
*** Checking out Alamofire at "3.5.1"
*** Checking out AlamofireImage at "2.5.0"
*** Checking out Reachability.swift at "v2.4"
*** Checking out SwiftyJSON at "54017d514a87b2b855b407131292c510cdeb65f8"
*** xcodebuild output can be found in /var/folders/6s/5fm277hs03qb526nqykyplk40000gn/T/carthage-xcodebuild.JxFgDC.log
*** Building scheme "Alamofire watchOS" in Alamofire.xcworkspace
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -workspace /Users/maor/myProj/myProj/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme Alamofire\ watchOS -configuration Release -derivedDataPath /Users/maor/Library/Caches/org.carthage.CarthageKit/DerivedData/Alamofire/3.5.1 -sdk watchos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6s/5fm277hs03qb526nqykyplk40000gn/T/carthage-xcodebuild.JxFgDC.log
carthage-xcodebuild.JxFgDC.log的一部分
=== CLEAN TARGET Alamofire watchOS OF PROJECT Alamofire WITH CONFIGURATION Release ===
Check dependencies
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
** CLEAN FAILED **
The following build commands failed:
Check dependencies
(1 failure)
=== BUILD TARGET Alamofire watchOS OF PROJECT Alamofire WITH CONFIGURATION Release ===
Check dependencies
“Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
最佳答案
如果安装两个版本的xcode,则可以执行以下操作:
执行shell:xcode-select -s(xcode.app的路径)