Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find host target(s) for Extension

Tags:

ios

cocoapods

Report

What did you do?

I tried to run the pod install command

What did you expect to happen?

Install all pod dependencies correctly like the 1.1.1 version do.

What happened instead?

[!] Unable to find host target(s) for myExtension1, myExtension2. Please add the host targets for the embedded targets to the Podfile. Certain kinds of targets require a host target. A host target is a "parent" target which embeds a "child" target. These are example types of targets that need a host target:
- Framework
- App Extension
- Watch OS 1 Extension
- Messages Extension (except when used with a Messages Application)

CocoaPods Environment

Stack

   CocoaPods : 1.2.1
        Ruby : ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin15]
    RubyGems : 2.4.5.1
        Host : Mac OS X 10.12.5 (16F73)
       Xcode : 8.3.3 (8E3004b)
         Git : git version 2.13.0
Ruby lib dir : /Users/dogo/.rbenv/versions/2.2.5/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 08682dc5b65d664048f43d7886a018856c692b63

Installation Source

Executable Path: /Users/dogo/.rbenv/versions/2.2.5/bin/pod

Plugins

claide-plugins        : 0.9.2
cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.2.0
cocoapods-try         : 1.1.0
slather               : 2.4.2

Podfile

source 'https://github.com/CocoaPods/Specs.git'  

project 'MyProject', 'DebugProduction' => :release , 'Integrated' => :release , 'Mock' => :release, 'DebugMock' => :debug  

platform :ios, '8.0'  

inhibit_all_warnings!  

def all_pods  
pod 'AFNetworkActivityLogger'  
pod 'AFNetworking'  
pod 'AMPopTip', '~> 1.0.0'  
pod 'BBBadgeBarButtonItem', '~> 1.2'  
pod 'Bricks', '~> 0.1.2'  
pod 'bricks-Mantle', '~> 0.1.0'  
pod 'CocoaLumberjack', '~> 2.2.0'  
pod 'Crashlytics'  
pod 'CustomIOSAlertView'  
pod 'Fabric'  
pod 'FBSDKCoreKit', '4.16.0'  
pod 'FBSDKLoginKit', '4.16.0'  
pod 'FBSDKShareKit', '4.16.0'  
pod 'FDKeychain', '~> 1.0.0'  
pod 'FSCalendar'  
pod 'GoogleAnalytics', '~> 3.17.0'  
pod 'GoogleConversionTracking', '~> 3.4.0'  
pod 'GoogleMaps', '2.3.1'  
pod 'HockeySDK', '4.1.6'  
pod 'JVFloatLabeledTextField'  
pod 'LGPlusButtonsView'  
pod 'MaryPopin', '1.4.2'  
pod 'MBProgressHUD'  
pod 'MGSwipeTableCell'  
pod 'MMWHaleImageCropper', '~> 0.1'  
pod 'NSStringMask', '1.2'  
pod 'ObjectiveSugar', '~> 1.1.0'  
pod 'PromiseKit', '~> 1.7.0'  
pod 'Realm', '~> 2.3.0'  
pod 'REFrostedViewController', '~> 2.4'  
pod 'RegExCategories', '~> 1.0'  
pod 'SMXMLDocument', '~> 1.1'  
pod 'SpotlightHandler', :git => 'https://github.com/renatosarro/SpotlightHandler'  
pod 'SRMonthPicker', '~> 0.2.10'  
pod 'TLInputsChainHelper', :git => 'https://github.com/thiagolioy/TLInputsChainHelper.git'  
pod 'TLJsonFactory'  
pod 'UITintedButton'  
pod 'XMLDictionary', '1.4'  
pod 'ZBarSDK'  
pod 'ZSWTaggedString', '~> 1.1'  
pod 'ZSWTappableLabel', '1.3'  
end  

target :MyProject do  
all_pods  
end  

target :'MyProject-cal' do  
all_pods  
end   

target :MyProjectExtension do  
pod 'GoogleAnalytics', '~> 3.17.0'  
end  

target :MyProject2 do  
all_pods  
end  

target :'MyProject2-cal' do  
all_pods  
end   

target :MyProjectExtension2 do  
pod 'GoogleAnalytics', '~> 3.17.0'  
end  

target :MyProjectTests do  
inherit! :search_paths  
pod 'Expecta'  
pod 'OCMock'  
pod 'Specta', '1.0.5'  
pod 'TLJsonFactory'  
end 
like image 894
Diogo Autilio Avatar asked Jul 31 '17 15:07

Diogo Autilio


1 Answers

The problem is not in the podfile, but in the project!

To fix:

  • Go to XCode
  • Select your HOST target.
  • Open the target's 'General' page
  • In the 'Embedded Binaries' section, make sure your EXTENSION target is present. enter image description here

  • In your Podfile you should have:

    target 'HostApp' do .... target 'YourExtension' do .... end end

like image 83
FrizzTheSnail Avatar answered Sep 22 '22 12:09

FrizzTheSnail