CocosPod 常见错误

从cocospod下载一个16年的老项目,然后pod install,安装一下第三方依赖。然后提示以下错误。

1
2
3
4
5
6
7
Re-creating CocoaPods due to major version update.
Analyzing dependencies
[!] The dependency `SnapKit (~> 0.17.0)` is not used in any concrete target.
The dependency `AVOSCloud (~> 3.1.3.6)` is not used in any concrete target.
The dependency `MJExtension` is not used in any concrete target.
The dependency `Kingfisher (~> 1.8)` is not used in any concrete target.
The dependency `MJRefresh` is not used in any concrete target.

我老的podfile文件是这样的

1
2
3
4
5
6
7
8
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

pod 'SnapKit', '~> 0.17.0'
pod 'AVOSCloud', '~> 3.1.3.6'
pod 'MJExtension'
pod 'Kingfisher', '~> 1.8'
pod 'MJRefresh'

修改后

1
2
3
4
5
6
7
8
9
10
11
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target "MJianshu" do

pod 'SnapKit', '~> 0.17.0'
pod 'AVOSCloud', '~> 3.1.3.6'
pod 'MJExtension'
pod 'Kingfisher', '~> 1.8'
pod 'MJRefresh'

end

重新pod install 就能下载了。

因为老的格式没有按下面的这个语法写。新的major版本不支持了。

1
2
3
target  "你的项目名" do
//这里填写你要添加的第三方依赖。
end

执行 pod setup 很慢很慢的解决方案

前期准备(安装过可以省略):1.查看ruby 2.更新 gem 3.安装cocoapods。

  1. pod repo remove master

  2. pod repo add master https://gitcafe.com/akuandev/Specs.git

会出现 [!] To setup the master specs repo, please run `pod setup`这里不用管它,继续
这一步把https改成git 速度上会快一点

  1. git clone git://gitclub.cn/CocoaPods/Specs.git ~/.cocoapods/repos/master
  2. pod repo update

//到这里结束大概20来分钟,你可以试一下 pod search masonry

0%