Cocoapods: [1.1.0.beta.1] Unable to find host target for Pods-ExampleShared

Created on 13 Jul 2016  路  9Comments  路  Source: CocoaPods/CocoaPods

What did you do?

Run 'pod install'

What did you expect to happen?

Install all pod dependencies correctly.

What happened instead?

[!] Unable to find host target for Pods-ExampleShared. Please add the host targets for the embedded targets to the Podfile.

CocoaPods Environment

Stack

   CocoaPods : 1.1.0.beta.1
        Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
    RubyGems : 2.0.14.1
        Host : Mac OS X 10.11.5 (15F34)
       Xcode : 7.3 (7D175)
         Git : git version 2.6.4
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : doist - [email protected]:Doist/doist-specs.git @ 8e5bc6d4c121dc2af892f9b123816f40eb8862aa
               master - https://github.com/CocoaPods/Specs.git @ 5aa14168d2ca5b0be1f8b4c4c9f90bab2ecea8c8

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.1.0

Most helpful comment

@orta @segiddins I fixed the issue by removing the target from the project and adding it again.

All 9 comments

Did you try following this part of the error?

Please add the host targets for the embedded targets to the Podfile.

( and can you show us your Podfile too please? )

@orta I'm not sure what to do with what the message says. Tried to find it on the docs of CocoaPods for the Podfile, but didn't find anything so far.

Podfile:

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

use_frameworks!

install! 'cocoapods',
         :deterministic_uuids => false,
         :integrate_targets => true,
         :deduplicate_targets => true

def developmentPods
    # Development Pods
end

def fabricPods
    pod 'Fabric'
    pod 'Crashlytics'
end

target 'Example' do
    platform :ios, '9.0'

    developmentPods
    fabricPods

    # Multiple pods

    target 'ExampleTests' do
       inherit! :search_paths
    end
end

target 'ExampleToday' do
    platform :ios, '9.0'

    developmentPods
    fabricPods
end

target 'ExampleShare' do
    platform :ios, '9.0'

    developmentPods
    fabricPods
end

target 'ExampleWatchOSExtension' do
    platform :watchos, '2.0'
    developmentPods
end

target 'ExampleShared' do
    platform :ios, '9.0'
    developmentPods
end

Hrm, I think you're going to need to go through the guides or some tutorials, those are my example Podfiles, which would only work if you had the same Xcode project as I had when setting it up.

I'd recommend using pod init to let cocoapods handle creating your target structure.

@orta What I see is that on the stack, the Xcode version says it's 7.3, but I'm using 8 Beta 2 right now. It may be the issue too?

Using the last stable version of CocoaPods it works as expected, it's just with the beta.

Please share a project that reproduces this issue, I think @benasher44 might want to take a look

@orta @segiddins I fixed the issue by removing the target from the project and adding it again.

I spent some time staring at this one to see if there was more I could do, but from what I can tell if the analyzer could find the today extension but not the share extension, then this feels like some kind of project corruption that would be fixed by re-adding the target. I'm open to thoughts on improving the error message here though, especially since it doesn't seem likely that there's much CocoaPods could have done at install-time to realize what was going on and fix it.

I also ran into this issue. Re-running `pod init' resolved the issue. For some reason, it seems that if I remove the autogenerated 'Test' target embedded in the main target, the issue resurfaces for me.

I ran into this when trying to add a target for a Notification extension in my app. I didn't have my Notification extension setup as a 'Target Dependency' on my App target.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mingmingmew picture Mingmingmew  路  3Comments

steffendsommer picture steffendsommer  路  3Comments

hmistry picture hmistry  路  3Comments

intelliot picture intelliot  路  3Comments

sonu5 picture sonu5  路  3Comments