12306ForMac icon indicating copy to clipboard operation
12306ForMac copied to clipboard

carthage update --platform macOS报错如何解决

Open HelloZQL opened this issue 6 years ago • 4 comments

HelloZQL avatar Oct 31 '18 03:10 HelloZQL

  1. 换成cocopod吧! 项目目录下: pod init
  2. 生成的文件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
  1. pod install
  2. 注释掉Xcode中的run script (## xxxxxxxxx) 这样对应的pod 版本就可以运行了

piaojin avatar Jan 04 '19 01:01 piaojin

一般是路径和版本的问题,下面是我的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"

执行成功 carthage

下载完成后生成的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 avatar Jan 06 '19 13:01 kissoflove

@kissoflove 哈哈我是没有安装carthage所以才改成cocopod

piaojin avatar Jan 06 '19 14:01 piaojin

@piaojin 我也改过cocoapods,遇到过很多奇奇怪怪的问题。。。

CoderLeonidas avatar May 13 '19 02:05 CoderLeonidas