- 今天升級 CocoaPods 到 1.8.4 版本,遇到了
CDN: trunk
報錯
圖1
圖2.png
解決方案:
- podfile文件中指定source源為master:在podfile頂部加入
source 'https://github.com/CocoaPods/Specs.git'
podfile文件中一定要指定master
源,因為現在默認是trunk
源 - 然后執行:
pod repo list 查看一下源列表
pod repo remove trunk 移除trunk源
該問題參考資料:
- 解決了CDN: trunk問題,又出現了 CocoaPods could not find compatible versions for pod "MJRefresh": In snapshot (Podfile.lock):
localhost:ProjectCtl xsh-ios$ pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "MJRefresh":
In snapshot (Podfile.lock):
MJRefresh (= 3.3.1)
In Podfile:
MJRefresh
None of your spec sources contain a spec satisfying the dependencies: `MJRefresh, MJRefresh (= 3.3.1)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
解決方法:
把Podfile.lock文件刪除,重新pod install一下就好了!
如果還不行把.xcworkspace也刪了。