1

对于需要 iOS 5.1 的 iOS 项目,我想包含一个至少需要 iOS 6.0 (ARChromeActivity) 的 Pod。当我尝试安装此 Pod 时,我只收到以下消息:

[!] The platform of the target `Pods` (iOS 5.1) is not compatible with `ARChromeActivity (1.0.0)` which has a minimum requirement of iOS 6.0.

无论如何,我怎样才能在我的项目中包含这个 Pod 而忽略这个单个 Pod 的基础 SDK?

4

2 回答 2

2

Disclaimer: The purpose of the podspec's platform attribute is to make sure the library isn't installed with a version of the OS it has not been tested on by its maintainers. That being said, in your Podfile you can simple change the platform requirements to what you want to emulate for example,

platform :ios, '6.0'

Obviously that is for all your pods not just a single one but you can see why that feature doesn't exist. In the newer versions of CocoaPods you actually don't need that line at all and it will detect your target version from your project, obviously since you're trying to use code that's not meant for the version you're using that wouldn't help you but it's typically quite useful.

Edit:

Alternatively you can edit the spec's source directly. In this case open ~/.cocoapods/master/ARChromeActivity/1.0.0/ARChromeActivity.podspec in some editor and change:

s.platform     = :ios, '6.0'

to

s.platform     = :ios, '5.0'

Then run pod install

于 2013-05-27T03:50:30.227 回答
0

正确的做法是不要更改 Podspec 中的 s.platform 而是修复s.io.deployment目标:

s.ios.deployment_target = '5.0'
于 2013-05-28T10:28:45.013 回答