在Podfile
文件中不指名版本号默认就是更新最新版:
platform :ios, '8.0'
target 'MyProject' do
pod 'FBAudienceNetwork'
end
不过有时候通过 pod install
更新某个第三方时,发现始终无法更新到最新版。通过pod search
时出来的结果是最新的,但是pod install
总是旧版。
此时如果强制将Podfile
文件中的SDK版本号改为最新版,然后pod install
后,会报错,提示target太低。
platform :ios, '8.0'
target 'MyProject' do
pod 'FBAudienceNetwork', '~>5.7.1'
end
[!] CocoaPods could not find compatible versions for pod "FBAudienceNetwork":
In Podfile:
FBAudienceNetwork (~> 5.7.1)
Specs satisfying the `FBAudienceNetwork (~> 5.7.1)` dependency were found, but they required a higher minimum deployment target.
然后一般立马会想到可能最新版SDK不再支持低版本,然后去xcode中修改deployment target,发现依然不行。其实正确的方法是修改Podfile
文件中的最低版本号:
platform :ios, '8.0'
改完后再试就成功了`。
网友评论