0

Right now I need to add LiveSDK to multiple targets. Please see below:

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

platform :ios, '7.0'

target :CalDoKit do
    pod 'LiveSDK'
end

pod 'Google-API-Client/Calendar'
pod 'LiveSDK'

As you can see the LiveSDK pod added twice. And I am getting warning from the console output when I run the application: One of the two will be used. Which one is undefined.

What's the correct way to add one pod to multiple targets?

New code:

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

platform :ios, '7.0'

link_with 'CalDo', 'CalDoKit'

pod 'LiveSDK'

target :CalDo do
    pod 'SVProgressHUD'
end

But I am getting warning:

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `TestKit` to `Pods/Target Support Files/Pods/Pods.debug.xcconfig` or include the `Pods/Target Support Files/Pods/Pods.debug.xcconfig` in your build configuration.
yong ho
  • 3,892
  • 9
  • 40
  • 81
  • possible duplicate of http://stackoverflow.com/questions/14906534/how-do-i-specify-multiple-targets-in-my-podfile-for-my-xcode-project – Jakub Vano May 26 '15 at 07:29
  • @JakubVano I couldn't understand the link_with. For example: `link_with 'MyApp', 'MyOtherApp'`. It didn't say which framework should included so both MyApp and MyOtherApp share the same framework. – yong ho May 26 '15 at 08:36

2 Answers2

0
  • Solution 1:

Remove that 'target :xx do ... end' and add pod without defining targets. It will add the pod for all targets.

  • Solution 2:

Delete that podfile and run pod init command from terminal. this will make a new podfile with all the targets used in the project and then you can add pods separately for each target

Shoaib
  • 2,286
  • 1
  • 19
  • 27
-1

Add this to the Podfile

target :AnotherTarget do
   pod 'LiveSDK'
end

EDIT

This is the final Podfile source

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

platform :ios, '7.0'

target :CalDoKit do
    pod 'LiveSDK'
end

target :OtherTarget do
    pod 'LiveSDK'
end

If you execute pod init console command on your project folder, it will create the Podfile with built in code.

See here: http://guides.cocoapods.org/syntax/podfile.html#target

Luca D'Alberti
  • 4,749
  • 3
  • 25
  • 45
  • That's exactly what I am doing. Please read my question completely. – yong ho May 26 '15 at 07:20
  • Possible duplication of [Multiple Target](http://stackoverflow.com/questions/14906534/how-do-i-specify-multiple-targets-in-my-podfile-for-my-xcode-project) – ridvankucuk May 26 '15 at 07:26