ios – 仅适用于指定平台的Cocoapod pod

前端之家收集整理的这篇文章主要介绍了ios – 仅适用于指定平台的Cocoapod pod前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个包含多个目标的 Xcode项目.其中一个目标是tvOS平台.我的其他目标使用’youtube-iso-player-helper’框架,它不支持tvOS.我想要一个仅在iOS上包含播放器框架的Cocoapod Podfile.

这是我当前的Podfile:

source 'https://github.com/CocoaPods/Specs.git' 
platform :ios,'8.0'
platform :tvos,'9.0'

use_frameworks!

pod 'SVGgh'

pod "youtube-ios-player-helper","~> 0.1"

xcodeproj 'MyProject.xcodeproj'

当我尝试更新我的pod时,出现以下错误

[!] The platform of the target Pods (tvOS 9.0) is not compatible with youtube-ios-player-helper (0.1.4),which does not support tvos.

显然,这是使用当前版本的Cocoapods.

所以,我需要知道我的Podfile所需的语法.

解决方法

这似乎对我有用:

target 'iOSAppTarget' do
  platform :ios,'8.0'
  pod 'PodForiOS'
end

target 'TVAppTarget' do
  platform :tvos,'9.0'
  pod 'PodForTV'
end

猜你在找的Xcode相关文章