【问题标题】:An unexpected version directory `Assets` was encountered for Private PodPrivate Pod 遇到了意外的版本目录“Assets”
【发布时间】:2017-05-25 07:37:03
【问题描述】:

我已经构建了一个私人 CocoaPods 存储库,用于我的公司。这个 repo 可以推送到 gitlab.com。程序是这样的:

//1
pod lib create PZResources

//2 change podspec
//3 add directory and images to PZResources.
//4 push these changes to gitlab.com. Then add tag and push tags to server.

//5 vertify spec 
pod spec lint --sources=https://zlanchun@gitlab.com/zlanchun/PZResources.git

//6 pod repo add 
pod repo add PZResources https://zlanchun@gitlab.com/zlanchun/PZResources.git

//6 pod repo push
pod repo push PZResources PZResources.podspec --sources=https://zlanchun@gitlab.com/zlanchun/PZResources.git

然后我打开一个新项目,对其进行 pod 处理,并将新库添加到 Podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '7.0'
source 'https://zlanchun@gitlab.com/zlanchun/PZResources.git'
source 'https://github.com/CocoaPods/Specs.git'

target 'PZDemo' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod "PZResources"
# Pods for PZDemo

end

经过以上步骤,出现这个错误:

[!] An unexpected version directory `Assets` was encountered for the `/Users/z/.cocoapods/repos/PZResources/PZResources` Pod in the `PZResources` repository.

我认为我的程序是正确的,但是发生了这个错误。不知道怎么回事。

【问题讨论】:

    标签: cocoapods gitlab


    【解决方案1】:

    随着时间的推移,我找到了这个答案。

    因为仓库对我来说是私有的,所以我需要一个 Specs 仓库来收集这些私有仓库。但我没有。于是就出现了错误。

    然后按照以下步骤,我解决了这个错误。

    1.Create a gitlab repo called Specs that used to collect private repo.
    2.add repo and push private repo to Specs.
    3.In Podfile, add source url.
    4.pod install
    

    例如:

    1.删除计算机缓存中的 pod repo

    $ pod repo list
    

    如果你有 PZResources repo,那么你应该删除它。

    $ pod repo remove PZResources
    

    2.将lib repo添加到远程Specs repo

    $ pod repo add PZResources https://zlanchun@gitlab.com/zlanchun/Specs.git
    

    3.push lib repo 到远程 Specs repo。你可以使用 --sources 。

    $ pod repo push PZResources PZResources.podspec --sources=https://zlanchun@gitlab.com/zlanchun/Specs.git
    

    可能需要用户名和密码,完成即可。

    4.创建一个测试项目和pod init,然后在Podfile中添加以下信息:

    //search private Specs. If this Specs cann't have repo, then seacrch github Specs.
    source 'https://zlanchun@gitlab.com/zlanchun/Specs.git'
    source 'https://github.com/CocoaPods/Specs.git'
    
    target 'TestPrivateLibRepo' do
        pod 'PZResources'
    end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多