Of course pod install

I downloaded a demo, hoping to learn more. Find a friend to help me to demo a good tune, his side has been running in the simulator, give me after I still can not run, there is error, it is recommended to perform pod install. This is the first time the IOS xcode use the required steps. Of course, to do this also depends on luck, good fast. I encountered various problems, eventually completed.

1. For the first pod of command you want to execute, you need to install CocoaPods: Open a terminal, if you do not have your execution pod setup, pod install, says you can not use this command

    OS X 10.11 previously, the terminal enter the following command:

    sudo gem install cocoapods

    After 10.11 OS X, the terminal enter the following command:

    sudo gem install -n /usr/local/bin cocoapods

2. Below you execute pod install, under normal circumstances will be unsuccessful, slow download speeds, the Metropolitan file fails, you will be prompted to perform the pod setup:

        

All items Podspec files are hosted https://github.com/CocoaPods/Specs. Under the first execution pod setup, CocoaPods these podspec will update the index file to the local ~ / .cocoapods / directory, the index file is large, there are about 300 M, after the execution of a pod install will be increased to more than 700 M. The first time it is very slow to update.

Need some understanding can look at the link below, thanks to the brothers
link: https: //www.jianshu.com/p/43a268ba8f47
Source: Jane books

 This writing is to go cloning a master file in the repo directory to install cocoa pod and update it. But github very slow, we all can not wait, but also prone to failure. Before I get there for a variety of problems, with the back of my cell phone to share wifi , a success. Everyone says that using a mobile phone is very effective, proven through a variety of practice
Like this:

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

Reference this link: https: //blog.csdn.net/drift_axe/article/details/54924359:

git config –global http.postBuffer 524288000

This problem still occurs.


cd  ~ / .cocoapods / rest /

You'll see a master

There are problems, we remove the master:

pod repo remove master

pod repo add master https://gitcafe.com/akuandev/Specs.git // github here Specs is not that, and that is too slow

This appears

[!] To setup the master specs repo, please run `pod setup`.

then

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之后的操作是:

[plain]  view plain  copy
  1. open App.xcworkspace  
       使用pod以后,项目的旧打开方式就不行了,必须到项目目录里面,打开“项目名. xcworkspace”这种方式来操作项目了。打开后没有错误了就是一些warming,之前的no such module"***"错误已经不见了。就可以开始运行了。



到此就结束了,希望可以帮助到需要的人








       










Guess you like

Origin blog.csdn.net/chengzuidongfeng/article/details/79664410