现在我需要将LiveSDK添加到多个目标。请参阅以下内容:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
target :CalDoKit do
pod 'LiveSDK'
end
pod 'Google-API-Client/Calendar'
pod 'LiveSDK'
正如您所看到的,LiveSDK pod添加了两次。当我运行应用程序时,我会从控制台输出中收到警告:One of the two will be used. Which one is undefined.
将一个pod添加到多个目标的正确方法是什么?
新代码:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
link_with 'CalDo', 'CalDoKit'
pod 'LiveSDK'
target :CalDo do
pod 'SVProgressHUD'
end
但我收到警告:
[!] 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.
答案 0 :(得分:0)
删除'target:xx do ... end'并添加pod而不定义目标。它将为所有目标添加pod。
删除该podfile并从终端运行pod init命令。这将创建一个包含项目中使用的所有目标的新podfile,然后您可以为每个目标单独添加pod
答案 1 :(得分:-1)
将其添加到Podfile
target :AnotherTarget do
pod 'LiveSDK'
end
修改强>
这是最终的Podfile
来源
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
target :CalDoKit do
pod 'LiveSDK'
end
target :OtherTarget do
pod 'LiveSDK'
end
如果在项目文件夹上执行pod init
console命令,它将创建带有内置代码的Podfile
。