网上下载了一个demo,希望从中可以学到更多。找了一个朋友帮我把demo调好了,他那边已经在模拟器上运行了,给我之后我还是不能运行,有错误提示,建议执行pod install。这个是IOS的xcode第一次用的时候是需要的步骤。当然要完成这一步也要看运气,好的就快了。我就遇到了各种问题,最终还是完成了。
1.首先对于pod的命令你想执行,需要安装CocoaPods:打开终端,如果你没有安装你执行pod setup,pod install,会提示不能用这个命令
OS X 10.11以前,在终端输入以下命令:
sudo gem install cocoapods
OS X 10.11以后,在终端输入以下命令:
sudo gem install -n /usr/local/bin cocoapods
2.下面你执行pod install,一般情况下都不能成功,下载速度慢,文件大都会失败,还会提示你执行pod setup:
需要一些了解可以看一下下面链接,感谢这位兄弟
链接:https://www.jianshu.com/p/43a268ba8f47
來源:简书
Cloning into 'master'...
remote: Counting objects: 2002848, done.
remote: Compressing objects: 100% (445/445), done.
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
参考这个链接:https://blog.csdn.net/drift_axe/article/details/54924359:
git config –global http.postBuffer 524288000
这样的问题还是会出现。
cd ~/.cocoapods/repos/
你会看到有个master
有问题的,我们移除master:
pod repo remove master
pod repo add master https://gitcafe.com/akuandev/Specs.git //这里的 Specs已经不是github的那个了,那个太慢
出现这个
[!] To setup the master specs repo, please run `pod setup`.
然后
git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
然后
pod repo update
然后
pod repo
出现下面就好了
master
- Type: git (master)
- URL: https://git.coding.net/CocoaPods/Specs.git
- Path: /Users/zhangzhihong/.cocoapods/repos/master
1 repo
然后 cd 到项目app.xcodeproj的同目录路径
cd /Users/..
然后
pod install --verbose --no-repo-update
执行完就好了。
项目老方式打开项目还是有bug:
no such module "..."
其实项目已经可以运行但是:请看下面
官方文档在pod install之后的操作是:
- open App.xcworkspace
到此就结束了,希望可以帮助到需要的人