1. 創(chuàng)建私有庫,將 NetworkStatus.podspec 配置文件push到私有庫 遇到問題
$ pod repo push Specs NetworkStatus.podspec
報(bào)錯(cuò)了 [!] Couldn't find NetworkStatus.podspec
解決方法: 在創(chuàng)建自己的 code Repository的時(shí)候最后一步操作不需要執(zhí)行 pod trunk push NetworkStatus.podspec 操作, 在上一步的位置操作(指的是在創(chuàng)建code repository的文件目錄下面操作)
2. - ERROR | [iOS] unknown: Encountered an unknown error (XXXXXX) during validation.
[!] The NetworkStatus.podspec
specification does not validate.
解決:版本標(biāo)簽需要推送到遠(yuǎn)程 git push --tags
3.
-> AWNetworkStatus (0.0.1)
- WARN | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
- WARN | url: There was a problem validating the URL git@xxxx.com:maling/AWNetworkStatus.
解決:不能使用git開頭的地址婴洼,需要使用http 或者 https 開頭的地址
4. - ERROR | [iOS] file patterns: The source_files
pattern did not match any file.
這個(gè)問題解決過程甚是頭疼撼嗓, 網(wǎng)上查找的都是說的文件路徑不對, 都沒給出解決方案粉捻,解決過程也是老費(fèi)勁了斑芜,解決方案:
/Users/Library/Caches/CocoaPods/Pods/External/xxxxxx/6caecc3e367ba2e8852334d3c51e1214-f25d4
xxxxxx
就是你要發(fā)布的pod庫文件
在這個(gè)路徑下你會(huì)發(fā)現(xiàn)沒有xxxxxx代碼文件,你可以直接拷貝一份放到/Users/Library/Caches/CocoaPods/Pods/External/xxxxxx/6caecc3e367ba2e8852334d3c51e1214-f25d4下面树酪,這個(gè)里面會(huì)有 xxxxxx文件续语,LICENSE, README.md 三個(gè)文件厦画,這個(gè)時(shí)候才是應(yīng)該有的內(nèi)容根暑。
5. - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use --verbose
for more information.
解決方案: 我導(dǎo)入的系統(tǒng)庫有沖突造成的,刪除導(dǎo)入的系統(tǒng)庫就好了
(遇到這個(gè)問題上網(wǎng)查找解決方案的時(shí)候發(fā)現(xiàn)畸裳,遇到的問題一樣淳地,解決方案各不相同颇象,猜測這個(gè)問題是各種不明確的問題都會(huì)報(bào)這個(gè)錯(cuò)誤,有可能這個(gè)解決方案不適合你扰魂,就需要你自己多看別人的解決方案是不是和你的一樣蕴茴,自己多嘗試荐开,反正我是通過刪除引用的系統(tǒng)庫這個(gè)問題就消失了)
6. - ERROR | [iOS] file patterns: The resources
pattern did not match any file.
遇到這個(gè)問題說明資源文件路徑不對,經(jīng)過檢查發(fā)現(xiàn)自己馬虎路徑寫錯(cuò)了將Classes/MGKit.bundle路徑寫成了Class/MGKit.bundle百侧,造成的錯(cuò)誤能扒。
解決方案: 仔細(xì)檢查podsepc路徑是不是和你實(shí)際文件的路徑一致。
7. ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for AWReachability
depended upon by AWAdsLib
) during validation.
解決方案:AWReachability 為私有庫辛润,不能創(chuàng)建庫的時(shí)候依賴私有庫,添加參數(shù)
--sources='https://github.com/CocoaPods/Specs.git, https://github.com/xxxx/xxSpecs.git
8. - ERROR | [AWAdsLib/Banner, AWAdsLib/Interstitial, AWAdsLib/Native, and more...] xcodebuild: Returned an unsuccessful exit code.
- NOTE | [iOS] [AWAdsLib/Native] xcodebuild: /Users/maling/Desktop/AWAdsLib/AWAdsLib/Native/WMD/AWAdWMDNativeAd.m:12:9: fatal error: 'WMAdSDK/WMAdSDKManager.h' file not found
解決方案: 文件引入問題砂竖,需要給AWAdWMDNativeAd引入需要的文件路徑
9. - NOTE | [AWAdsLib/Interstitial,AWAdsLib/Native] xcodebuild: clang: error: linker command failed with exit code 1 (use -v to see invocation)
解決方案: 靜態(tài)庫引入問題乎澄,在需要使用靜態(tài)庫的地方引入靜態(tài)庫
10.上傳私有庫完成后 添加類文件,上傳成功pod下載下來的數(shù)據(jù)沒有
pod lib lint --verbose --use-libraries --allow-warnings --no-clean
git add .
git commit -m "commit2"
git push origin master
pod repo push AWSpecs AWAdsLib.podspec --verbose --use-libraries --allow-warnings
解決方案: 重新打了一個(gè)tag標(biāo)簽 驗(yàn)證通過解恰,提交成功浙于, 下載成功
11. - ERROR | [AWAdsLib/Native] xcodebuild: Returned an unsuccessful exit code.
- NOTE | [AWAdsLib/Native] xcodebuild: error: invalid task ('StripNIB /Users/maling/Library/Developer/Xcode/DerivedData/App-fyjwbdljqyusxfdkoqquzzllyqoi/Build/Products/Release-iphonesimulator/AWAdsLib/AWGADUnifiedNativeAdView.nib') with mutable output but no other virtual output node (in target 'AWAdsLib')
解決方案:因?yàn)閤ib和圖片等屬于資源文件羞酗,不能放在源文件中(Classes),需要放在Assets中脏款,如果都放在classes中撤师,在驗(yàn)證的時(shí)候會(huì)遇到這個(gè)問題:)
12.[!] Found multiple specifications for AWReachability (0.0.1)
:
[!] Found multiple specifications for AWReachability (0.0.1)
:
/Users/maling/.cocoapods/repos/master/Specs/7/0/b/AWReachability/0.0.1/AWReachability.podspec.json
/Users/maling/.cocoapods/repos/AWSpecs/AWReachability/0.0.1/AWReachability.podspec
原因:將私有倉庫拉到本地時(shí)可能會(huì)存在兩個(gè)拧揽。
解釋:因?yàn)?git 存在兩個(gè)地址淤袜,分別是 git@ 和 http/https,所以有時(shí)候可能會(huì)在本地 repos 下出現(xiàn)兩個(gè)基于同一個(gè) git 的倉庫积蔚,倉庫名字不同烦周。因?yàn)橐婚_始 lint 的時(shí)候是指定了倉庫名的读慎,所以能通過,但 pod repo push 的時(shí)候雖然指定了 push 的倉庫名幅狮,但因?yàn)闆]有指定校驗(yàn)的倉庫名,一旦你的 pod 依賴了私有倉庫中的某個(gè) pod擎值,校驗(yàn)時(shí)會(huì)出現(xiàn)類似 [!] Found multiple specifications xxxxLibrary 的錯(cuò)誤逐抑。此時(shí)需要?jiǎng)h除掉一個(gè)私有倉庫泵肄,然后重新 push 才行淑翼。
備注:這里需要明白 pod spec lint 的時(shí)候,可以配置 --sources冯丙。而 pod repo push 的時(shí)候遭京,是直接使用的本地倉庫名哪雕。有可能 --sources 指定的是 http/https ,而本地 repo 倉庫是使用的 git@ 拉取的利虫。
pod spec lint --verbose --use-libraries --allow-warnings --sources='私有倉庫repo地址,https://github.com/CocoaPods/Specs'
pod repo push MCRepo MCAppKit.podspec --verbose --use-libraries --allow-warnings
該解決方案來自這里地址
13 - ERROR | [iOS] unknown: Encountered an unknown error (/usr/bin/xcrun simctl list -j devices
xcrun: error: active developer path ("/Applications/Xcode11.1.app/Contents/Developer") does not exist
Use sudo xcode-select --switch path/to/Xcode.app
to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install
to install the standalone command line developer tools.
See man xcode-select
for more details.
14. 執(zhí)行pod repo push UCSpecs 'UCAAChartKit.podspec' --allow-warnings
報(bào)錯(cuò)信息 如下:
[!] /usr/bin/git -C /Users/xxxx/.cocoapods/repos/UCSpecs pull
Your configuration specifies to merge with the ref 'refs/heads/master'
from the remote, but no such ref was fetched.
報(bào)錯(cuò)原因是: UCSpecs倉庫沒有內(nèi)容, 需要上傳內(nèi)容,
解決方案: 上傳了一個(gè) readme.md
文件 就可以了, 其他文件也可以.
15. 執(zhí)行 pod lib lint
或者pod spec lint
報(bào)錯(cuò) include of non-modular header inside framework module
解決方案1:
在.podspec文件中添加
s.user_target_xcconfig = { 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES' }
解決方案 2: 執(zhí)行的時(shí)候加上參數(shù) --use-libraries
pod lib lint --verbose --allow-warnings --use-libraries
或者
pod spec lint --verbose --allow-warnings --use-libraries
如果之前在pod spec lint時(shí)使用了--allow-warnings或--use-libraries,這里在pod trunk push也需要添加