您现在的位置是:首页 > 文章详情

iOS组件化开发一本地环境配置(一)

日期:2018-07-12点击:445

首先我们要使用pod支持组件化开发

  • 解决CocoaPods慢的方案(gem和pod repo换源)
  • gem换源 
    $ gem sources --remove https://rubygems.org/ # 移除默认源 
    $ gem sources -a https://gems.ruby-china.org/ # 添加Ruby China镜像 
    $ gem sources -l 

    确保只有gems.ruby-china.org源


    pod repo换源 
    $ pod repo 

    默认是GitHub源


    master 
    - Type: git (master) 
    - URL: https://github.com/CocoaPods/Specs.git 
    - Path: /Users/cheng/.cocoapods/repos/master 
    1 repo 

    我们把它换成Coding.net源

  • $ pod repo remove master 
    $ pod repo add master https://git.coding.net/CocoaPods/Specs.git 
    $ pod repo update 

    如果执行pod repo add出现错误

  • 错误 


    那么使用以下办法


    $ git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master 
    $ pod repo update 

    另外,如果Podfile文件中有


    source 'https://github.com/CocoaPods/Specs.git' 

    也需要把它换成repo的源,否则依然是使用GitHub源
    上面的步骤都完成后,即可使用


    $ pod install 
    $ pod update 

pod search AFNetworking

出现错误:

1、what did you do ?

2、Unable to find a pod with name, author, summary, or descriptionmatching

等错误

删除~/Library/Caches/CocoaPods目录下的search_index.json文件

pod setup成功后,依然不能pod search,是因为之前你执行pod search生成了search_index.json,此时需要删掉。

终端输入:rm ~/Library/Caches/CocoaPods/search_index.json

删除成功后,再执行pod search。

pod search MobileKit

 

[!] An unexpected version directory `Classes` was encountered for the `/Users/zhangpeng/.cocoapods/repos/gitee-peter_zhang-mobilekit/MobileKit` Pod in the `MobileKit` repository.

$ cd /Users/zhangpeng/.cocoapods/repos/

$ ls

master   gitee-peter_zhang-mobilekit.   MobileKitSpec

删除多余的

 

 

 

 

原文链接:https://yq.aliyun.com/articles/614878
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章