CocoaPods link_with
CocoaPods link_with
我正在尝试为不同的目标包含不同的库。
link_with 'Target 1', 'Target 2', 'Target 3'
platform :ios, '7.0'
pod 'MMWormhole', '~> 1.1.1'
link_with 'Target 4', 'Target 5'
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.5'
pod 'MBProgressHUD', '~> 0.8'
pod 'MMWormhole', '~> 1.1.1'
怎么做?
解决方案
(感谢 SalvoC 提供解决方案!)
target :'Main App', :exclusive => true do
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.5'
pod 'MBProgressHUD', '~> 0.8'
pod 'MMWormhole', '~> 1.1.1'
platform :ios, '8.0'
pod 'SplunkMint'
end
target :'Main App Extension', :exclusive => true do
platform :ios, '7.0'
pod 'MMWormhole', '~> 1.1.1'
end
在 Podfile 中更改目标配置时,请确保删除所有先前生成的 *.a 文件。它们对每个目标都存在,并且您在构建时会收到有关 "duplicates" 的错误。
如果您手动更改了 "Other Linker Flages",请确保在 运行 pod install 之前删除旧条目并放入 $(inherited).
干杯
在这种情况下,您不应该使用 link_with。
试试这个:
target :'Target 1', :exclusive => true do
platform :ios, '7.0'
pod 'MMWormhole', '~> 1.1.1'
end
并为每个目标指定语句
Cocoapods 1.0 删除了 link_with & exclusive => true 以支持 abstract_target.
正如秋浪所说,abstract_target 现在是 link 多个 pods 和多个目标的方式:
abstract_target 'someNameForAbstractTarget' do
pod 'podThatIsForAllTargets'
end
target 'realTarget' do
pod 'podThatIsOnlyForThisTarget'
end
我正在尝试为不同的目标包含不同的库。
link_with 'Target 1', 'Target 2', 'Target 3'
platform :ios, '7.0'
pod 'MMWormhole', '~> 1.1.1'
link_with 'Target 4', 'Target 5'
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.5'
pod 'MBProgressHUD', '~> 0.8'
pod 'MMWormhole', '~> 1.1.1'
怎么做?
解决方案 (感谢 SalvoC 提供解决方案!)
target :'Main App', :exclusive => true do
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.5'
pod 'MBProgressHUD', '~> 0.8'
pod 'MMWormhole', '~> 1.1.1'
platform :ios, '8.0'
pod 'SplunkMint'
end
target :'Main App Extension', :exclusive => true do
platform :ios, '7.0'
pod 'MMWormhole', '~> 1.1.1'
end
在 Podfile 中更改目标配置时,请确保删除所有先前生成的 *.a 文件。它们对每个目标都存在,并且您在构建时会收到有关 "duplicates" 的错误。
如果您手动更改了 "Other Linker Flages",请确保在 运行 pod install 之前删除旧条目并放入 $(inherited).
干杯
在这种情况下,您不应该使用 link_with。 试试这个:
target :'Target 1', :exclusive => true do
platform :ios, '7.0'
pod 'MMWormhole', '~> 1.1.1'
end
并为每个目标指定语句
Cocoapods 1.0 删除了 link_with & exclusive => true 以支持 abstract_target.
正如秋浪所说,abstract_target 现在是 link 多个 pods 和多个目标的方式:
abstract_target 'someNameForAbstractTarget' do
pod 'podThatIsForAllTargets'
end
target 'realTarget' do
pod 'podThatIsOnlyForThisTarget'
end