美文网首页移动开发俱乐部
pod install报错问题解决的思路

pod install报错问题解决的思路

作者: 恩莱客 | 来源:发表于2021-06-25 17:24 被阅读0次

    1. 索引库

    cocoaPods的本地仓库

    cd ~/.cocoapods/repos
    liqun@liqundeMacBook-Pro YiQiXiuCompany % pod repo list
    EqxiuRepo
    - Type: git (master)
    - URL:  http://gitlab.yqxiu.cn/app-ios/eqxiurepo.git
    - Path: /Users/liqun/.cocoapods/repos/EqxiuRepo
    
    master
    - Type: git (master)
    - URL:  https://github.com/CocoaPods/Specs.git
    - Path: /Users/liqun/.cocoapods/repos/master
    
    trunk
    - Type: CDN
    - URL:  https://cdn.cocoapods.org/
    - Path: /Users/liqun/.cocoapods/repos/trunk
    
    volcengine
    - Type: git (master)
    - URL:  https://github.com/volcengine/volcengine-specs.git
    - Path: /Users/liqun/.cocoapods/repos/volcengine
    
    4 repos
    
    pod说明书
    找到Specs文件任意文件(索引文件),打开如下:
    名称、项目版本、描述、项目位置、作者、系统、库tag(版本)、库路径、资源文件路径等
    {
      "name": "CAIStatusBar",
      "version": "0.0.1",
      "summary": "A simple indicator",
      "homepage": "https://github.com/apple5566/CAIStatusBar.git",
      "license": "MIT",
      "authors": {
        "apple5566": "zaijiank110@sohu.com"
      },
      "platforms": {
        "ios": "6.0"
      },
      "source": {
        "git": "https://github.com/apple5566/CAIStatusBar.git",
        "tag": "0.0.1"
      },
      "source_files": "CAIStatusBar/**/*.{h,m}",
      "resources": "CAIStatusBar/CAIStatusBar.bundle",
      "requires_arc": true
    }
    

    2. pod install

    cocoaPods根据索引库安装,继续以CAIStatusBar为例:
    根据名称、tag值等索引文件信息确定安装的Pod库。

    pod 'CAIStatusBar', '~> 0.0.1'
    

    但如果找不到CAIStatusBar的索引文件,就会报各种错,别着急
    了解现在最主要的工作是要找到索引文件,索引文件可能在不同的索引库中,刚开始就介绍了我的本地仓库:
    一般trunk和master索引分支包含了99.99%的索引信息,所以如果存在这两个分支,pod install按理说一般没问题,其实不然,需要确定在哪个分支下下(source 源)。

    liqun@liqundeMacBook-Pro YiQiXiuCompany % pod repo list
    // 私有库
    EqxiuRepo
    - Type: git (master)
    - URL:  http://gitlab.yqxiu.cn/app-ios/eqxiurepo.git
    - Path: /Users/liqun/.cocoapods/repos/EqxiuRepo
    
    master
    - Type: git (master)
    - URL:  https://github.com/CocoaPods/Specs.git
    - Path: /Users/liqun/.cocoapods/repos/master
    
    trunk
    - Type: CDN
    - URL:  https://cdn.cocoapods.org/
    - Path: /Users/liqun/.cocoapods/repos/trunk
    
    volcengine
    - Type: git (master)
    - URL:  https://github.com/volcengine/volcengine-specs.git
    - Path: /Users/liqun/.cocoapods/repos/volcengine
    
    4 repos
    

    pod install 有个小技巧,如果确定pod 索引库在哪个分支(source)下,就只保留那个分支(source),进行pod install,pod 库也可以注释分布安装。如下:

    source 'http://gitlab.yqxiu.cn/app-ios/eqxiurepo'
    source 'https://cdn.cocoapods.org/'
    source 'https://github.com/CocoaPods/Specs.git'
    

    注:安装失败的好多时候是因为github.com网不好,如下总是失败,需要多次尝试

    [!] Error installing GPUImage
    [!] /usr/bin/git clone https://github.com/BradLarson/GPUImage.git /var/folders/j8/3nnb0qx12v73mcgqvj36zrxc0000gn/T/d20210625-33724-7bxom1 --template= --single-branch --depth 1 --branch 0.1.7
    
    Cloning into '/var/folders/j8/3nnb0qx12v73mcgqvj36zrxc0000gn/T/d20210625-33724-7bxom1'...
    fatal: unable to access 'https://github.com/BradLarson/GPUImage.git/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 
    
    

    要点总结:确定索引库的存在,找到对应源pod install

    相关文章

      网友评论

        本文标题:pod install报错问题解决的思路

        本文链接:https://www.haomeiwen.com/subject/obsoyltx.html