Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapod pod only for a specified platform

I have an Xcode project with multiple targets. One of those targets targets the tvOS platform. My other targets make use of the 'youtube-iso-player-helper' framework, which does not support tvOS. I want to have a Cocoapod Podfile that includes the player framework only on iOS.

Here is my current 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'

When I try to update my pods, I get the following error:

[!] 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.

Obviously, this is using the current version of Cocoapods.

So, I need to know the syntax required for my Podfile.

like image 829
Glenn Howes Avatar asked Oct 31 '22 17:10

Glenn Howes


1 Answers

This seems to work for me:

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

target 'TVAppTarget' do
  platform :tvos, '9.0'
  pod 'PodForTV'
end
like image 50
Claes Avatar answered Nov 12 '22 09:11

Claes