I have been using CocoaPods for a few weeks now with my iOS app and it works perfectly with the one target I have been testing (let's call it "MainApp"). However, I now want to build a different target ("MyAppLite") and noticed that the build failed (file not found on one of the pods' header files).
The differences in the Build Settings I've noticed are as follows:
platform :ios, '5.0'
pod 'TTTAttributedLabel', '~> 1.7.0'
pod 'iRate', '~> 1.7.5'
pod 'MBProgressHUD', '~> 0.6'
pod 'FlurrySDK', '~> 4.2.3'
pod 'ACSimpleKeychain', '~> 0.0.1'
pod 'WEPopover', '~> 0.0.1'
pod 'AFNetworking', '~> 1.3.1'
pod 'Nimbus', '~> 1.0.0'
pod 'QuincyKit', '~> 2.1.9'
You can use the
platform :ios, '5.0' pod 'TTTAttributedLabel', '~> 1.7.0' pod 'iRate', '~> 1.7.5' pod 'MBProgressHUD', '~> 0.6' pod 'FlurrySDK', '~> 4.2.3' pod 'ACSimpleKeychain', '~> 0.0.1' pod 'WEPopover', '~> 0.0.1' pod 'AFNetworking', '~> 1.3.1' pod 'Nimbus', '~> 1.0.0' pod 'QuincyKit', '~> 2.1.9' link_with "MyApp" link_with "MyAppLite"
This will produce
libPods.a and it will link it to
Note, that cocoapods automatically links every target in the podfile with your project. For this reason the names of the targets should match. If for any reason you want to specify a target in your podfile with a different name, you can set the
target :test, :exclusive => true do link_with 'MyAppTests' end
Targets, by default, are exclusive if their parent has a different platform.
The main target of the Podfile, is always linked with the first target of the final Project.