Integrating pods with all targets

podfile multiple targets
pod source
cocoapods local pod
pod file in ios
pod platform
cocoapods minimum deployment target
podfile swift version
post_install do |installer

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:

  • Other Linker Flags does not contain the required frameworks in MyAppLite
  • Framework/Header/Library Search Paths are all empty in MyAppLite
  • None of the User-Defined Build Settings in MainApp are present in MyAppLite

How can I ensure that when I run pod install, all targets have the libraries linked?

For reference, here is my Podfile:

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'

For CocoaPods 1.0.0, recommendation from devs is using abstract_target (but not compatible with 0.39.0):

platform :ios, '5.0'

abstract_target 'defaults' do
    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'

    target 'MyApp'
    target 'MyAppLite'
end

For CocoaPods 0.39.0 + 1.0.0 compatibility, using def works fine (but isn't recommended by devs):

platform :ios, '5.0'

def default_pods
    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'
end

target 'MyApp' do
    default_pods
end

target 'MyAppLite' do
    default_pods
end

Link with different Pods according to the build configuration · Issue , pod 'AFNetworking' # For all build configurations, Debug and Release target Feature Request: Add a post project integration hook for after pod integration  Shop for all laundry detergent online at Target. Free shipping on orders of $35+ and save 5% every day with your Target RedCard.


With CocoaPods 1.x

You can use the target blocks

platform :ios, '13.0'


def default_pods
    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'
end

target 'MyApp' do
  default_pods
end

target 'MyAppLite' do
  default_pods
end

Relevant documentation

Cannot include a pod in multiple targets with different platform , I would like to include a pod in both my iOS target, and my watchOS 2 target, however, when I attempt to do so, I get Integrating client project. We can now set different resources for each target or set different titles for each Xcdoe target. Update the pod file to support multiple Xcode targets. Now that we have set up iOS multiple targets, our next step is to update the pods file so that it supports both the targets. Our existing pod file looks something like this


If you have large number of targets and don't want to add new target each time, you can use this

def common_pods

   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'

end

project = Xcodeproj::Project.open "./<projectNameHere>.xcodeproj"

project.targets.each do |t|

target t.name do

    common_pods

end

Multiple Xcode Targets with CocoaPods Tutorial, Use multiple Xcode targets with CocoaPods to develop two types of iOS apps using needed the application in 4 different variants which made the situation all the In order to show the image, we are going to integrate an image cache library  CocoaPods has been used to integrate ~285,000,000 pods into ~850,000 unique Xcode targets. Changes. Let's get the changes in 1.0 out of the way first. The overarching principle we followed was to prepare CocoaPods, the tool, for the next five years - rather than introducing any individual feature.


From the docs:

If no explicit target is specified, then the Pods target will be linked with the first target in your project.

You can use link_with to link with further targets.

Also see Multiple Targets in the Cocoapods documentation if you need different dependency configurations for different targets

Class: Pod::AggregateTarget, The aggregate targets whose pods this target must be able to import, but will not directly link against. List all user targets that will be integrated by this #target. On closer inspection, it looks like the Pods-ProjectB-Mac and Pods-ProjectB-iOS targets in the Pods project actually do have a Target Dependency -- but it's on the ProjectA INTUGroupedArray target. If the INTUGroupedArray Pod target is to be shared here, this doesn't seem right.


Podfile Syntax Reference, The Podfile is a specification that describes the dependencies of the targets of one or more Xcode projects. A Podfile can be very simple: target 'MyApp' pod  will result in two Pod targets: MyPod and MyPod-SubA. this option defaults to true.:deterministic_uuids. Whether to generate deterministic UUIDs when creating the Pods project. this option defaults to true.:integrate_targets. Whether to integrate the installed pods into the user project


CocoaPods 1.7.0 Beta!, The above configuration will successfully integrate CoconutLib pod and of a Podfile in which case it will apply to all targets within the Podfile . Shop Target for AirPods at great prices. Free shipping on orders $35+ or free same-day pickup in store. Target / Ways to Shop / Brand Experiences / All Deals :


How to use CocoaPods with your internal iOS frameworks, The way it integrates code into your project is by creating a framework target for all the following changes on a branch in the repo called use-cocoapods , but  Categories Women Men Young Adult Kids Shoes Baby Home Patio & Garden Furniture Kitchen & Dining Toys Electronics Video Games Movies, Music & Books Sports & Outdoors Beauty Personal Care Health Household Essentials Pets Grocery Luggage School & Office Supplies Party Supplies Bullseye's Playground Clearance Holiday Shop Target Finds What’s New