Private Pod遇到意外的版本目录`Assets`

问题描述 投票:2回答:1

我已经构建了一个在我公司使用的私有CocoaPods仓库。这个回购可以推送到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://[email protected]/zlanchun/PZResources.git

//6 pod repo add 
pod repo add PZResources https://[email protected]/zlanchun/PZResources.git

//6 pod repo push
pod repo push PZResources PZResources.podspec --sources=https://[email protected]/zlanchun/PZResources.git

然后我打开一个新项目,将其挂起,并将新库添加到Podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '7.0'
source 'https://[email protected]/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个回答
2
投票

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

因为回购对我来说是私有的,我需要一个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://[email protected]/zlanchun/Specs.git

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

$ pod repo push PZResources PZResources.podspec --sources=https://[email protected]/zlanchun/Specs.git

也许它需要一个用户名和密码,只需完成它。

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

//search private Specs. If this Specs cann't have repo, then seacrch github Specs.
source 'https://[email protected]/zlanchun/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

target 'TestPrivateLibRepo' do
    pod 'PZResources'
end
© www.soinside.com 2019 - 2024. All rights reserved.