Cocoapod pod for a specific platform only

I have an Xcode project with several goals. One of these goals is aimed at the tvOS platform. My other goals use the youtube-iso-player-helper framework, which does not support tvOS. I want to have a Cocoapod podcast that includes the player platform only on iOS.

Here is my current subfile:

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 modules, I get the following error:

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

Obviously, the current version of Cocoapods is being used.

So, I need to know the syntax needed for my subfile.

+4
source share
4

, :

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

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

, . target link_with pod :

target :tvos, :exclusive => true do
    use_frameworks!
    link_with 'AppName'
    pod "youtube-ios-player-helper", "~> 0.1"
end
0

, , :

source 'https://github.com/CocoaPods/Specs.git'  

def shared_pods
    pod 'SVGgh'
end

target 'myiOSTargetName' do
    platform :ios, '8.0'
    use_frameworks! 
    shared_pods
    pod "youtube-ios-player-helper", "~> 0.1"
end

target 'mytvOSTargetName' do
    platform :tvos, '9.0'  
    use_frameworks! 
    shared_pods
end

, , !

0
0

Source: https://habr.com/ru/post/1612157/


All Articles