2017-05-25 52 views
1

我已經構建了一個用於我公司的私有CocoaPods庫。這個回購可以推到gitlab.com。過程是這樣的:一個意外的版本目錄「Assets」遇到了Private Pod

//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. 

我認爲我的程序是正確的,但是發生了這個錯誤。我不知道什麼是錯的。

回答

1

隨着時間的推移,我找到了它的答案。

因爲回購對我來說是私人的,所以我需要一個規格來收集這些私人回購。但我沒有。所以發生錯誤。

然後按照吹打步驟,我解決了這個錯誤。

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.delete莢回購

$ pod repo list 

如果有PZResources回購,那麼你應該將其刪除。

$ pod repo remove PZResources 

。2.加LIB回購到遠程功能回購

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

3.push LIB回購到遠程功能回購。您可以使用--sources。

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

也許它需要一個用戶名和密碼,只需完成它。

4.Create一個測試項目和莢初始化,然後在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 
相關問題