一个Xcode工程多个target的第三方依赖库管理

2017-07-24  本文已影响64人  SySean

Pofile配置

platform :ios, '8.0'
# Note: There are no targets called "Target_Common" in any of this workspace's Xcode projects
abstract_target 'Target_Common' do
    pod 'AFNetworking', '~> 3.0'
    pod 'BlocksKit', '~> 2.2.5'
    pod 'PureLayout', '~> 2.0.5'
    pod 'ReactiveCocoa', '~> 2.5'
    pod 'ReactiveViewModel', '~> 0.3'
    ...
    
    target 'Target_Sub01' do
        pod 'HMSegmentedControl'
        ...
    end
    target 'Target_Sub02' do
        pod 'TTRangeSlider', '~> 1.0.4'
        ...
    end
end

参考Podfile官方配置文档


提一下

工程多了以后,很可能会出现第三方库链接失败的问题,或者导致build失败,或者导致打包失败。

Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Linker command failed

提供一个简单粗暴的解决方案:

上一篇 下一篇

猜你喜欢

热点阅读