CocoaPods could not find compatible versions for pod "SnapKit"

podfile中新增SnapKit

 platform :ios, '9.0'
target 'xxxxx' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  pod 'SnapKit', '~> 5.0.1' 

报错如下:

[!] CocoaPods could not find compatible versions for pod "SnapKit":
  In Podfile:
    SnapKit (~> 5.0.1)

Specs satisfying the `SnapKit (~> 5.0.1)` dependency were found, but they required a higher minimum deployment target.

they required a higher minimum deployment target.可知SnapKit和当前target版本(platform:ios,'9.0')不匹配!

解决方法

方法1.提高当前target版本(platform:ios,'10.0')
方法2.使用匹配当前target版本(platform:ios,'9.0')的SnapKit版本!
使用podsearch SnapKit 查看可用版本或者去SnapKit主页挑选匹配版本

SnapKit (5.0.1)
   Harness the power of auto layout with a simplified, chainable, and compile time safe syntax.
   pod 'SnapKit', '~> 5.0.1'
   - Homepage: https://github.com/SnapKit/SnapKit
   - Source:   https://github.com/SnapKit/SnapKit.git
   - Versions: 5.0.1, 5.0.0, 4.2.0, 4.0.1, 4.0.0, 3.2.0, 3.1.2, 3.0.2, 3.0.1, 3.0.0, 0.30.0.beta2, 0.30.0.beta1, 0.22.0, 0.21.1, 0.21.0, 0.20.0, 0.19.1,
   0.19.0, 0.18.0, 0.17.0, 0.16.0, 0.15.0, 0.14.0, 0.13.0, 0.12.0, 0.11.0, 0.10.0 [trunk repo]

podfile修改如下:

   platform :ios, '9.0'
   pod 'SnapKit', '~> 4.2.0'
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容