12306ForMac
12306ForMac copied to clipboard
carthage update --platform macOS报错如何解决
- 换成cocopod吧! 项目目录下:
pod init
- 生成的文件Podfile中输入对应用到的库:
target '12306ForMac' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for 12306ForMac
pod 'Alamofire', '~> 4.0.0'
pod 'XCGLogger', '~> 5.0.5'
pod 'SwiftyJSON', '~> 4.0.0'
pod 'FMDB', '~> 2.6.2'
pod 'OMGHTTPURLRQ', '~> 3.2.2'
pod 'PromiseKit', '~> 4.1.0'
pod 'MASPreferences', '~> 1.1.4'
end
-
pod install
- 注释掉
Xcode
中的run script
(## xxxxxxxxx) 这样对应的pod 版本就可以运行了
一般是路径和版本的问题,下面是我的Cartfile文件:
#github "Alamofire/Alamofire" == 4.0 #报错,改用github "https://github.com/Alamofire/Alamofire.git" #A shell task (/usr/bin/env git clone --bare --quiet https://github.com/Alamofire/Alamofire.git /var/root/Library/Caches/org.carthage.CarthageKit/dependencies/Alamofire) failed with exit code 128: #error: RPC failed; curl 18 transfer closed with outstanding read data remaining #fatal: The remote end hung up unexpectedly #fatal: early EOF #fatal: index-pack failed github "https://github.com/Alamofire/Alamofire.git" github "ccgus/fmdb" == 2.6.2 github "mxcl/OMGHTTPURLRQ" == 3.2.2 github "mxcl/PromiseKit" == 4.1.0 github "DaveWoodCom/XCGLogger" # == 5.0.5 #若指定版本则报错 #A shell task (/usr/bin/env git clone --bare --quiet https://github.com/DaveWoodCom/XCGLogger.git /var/root/Library/Caches/org.carthage.CarthageKit/dependencies/XCGLogger) failed with exit code 128: #error: RPC failed; curl 18 transfer closed with outstanding read data remaining #fatal: The remote end hung up unexpectedly #fatal: early EOF #fatal: index-pack failed github "shpakovski/MASPreferences" == 1.1.4 github "SwiftyJSON/SwiftyJSON"
执行成功
下载完成后生成的Cartfile.resolved文件
github "Alamofire/Alamofire" "4.8.0" github "DaveWoodCom/XCGLogger" "6.1.0" github "SwiftyJSON/SwiftyJSON" "4.2.0" github "ccgus/fmdb" "2.6.2" github "mxcl/OMGHTTPURLRQ" "3.2.2" github "mxcl/PromiseKit" "4.1.0" github "shpakovski/MASPreferences" "1.1.4"
@kissoflove 哈哈我是没有安装carthage所以才改成cocopod
@piaojin 我也改过cocoapods,遇到过很多奇奇怪怪的问题。。。