Run pod install
Install all pod dependencies correctly.
[!] Unable to find host target for Pods-Progression. Please add the host targets for the embedded targets to the Podfile.
CocoaPods : 1.1.0.beta.1
Ruby : ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
RubyGems : 2.5.1
Host : Mac OS X 10.11.5 (15F34)
Xcode : 8.0 (8S162m)
Git : git version 2.8.2
Ruby lib dir : /usr/local/Cellar/ruby/2.3.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 0004bc97b73d96cb1a23ad0868c93178899ca7d6
Executable Path: /usr/local/bin/pod
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
project 'Progression.xcodeproj'
platform :osx, '10.9'
swift_version="3"
use_frameworks!
target 'Progression' do
pod 'Lazy', '~> 1.1.0'
end
Other issues that seem to display the same error:
I've attempted recreating the target but that doesn't fix it.
This might be fixed by https://github.com/CocoaPods/CocoaPods/pull/5637
That's failing the Travis build currently 馃槥. Guess I'll resort to submodules or 1.0.1 until this is resolved. Thanks!
鎬庝箞瑙e喅锛岃璧愭暀
I'm getting the same issue but have been unable to isolate it. I have two (existing) xcode projects, and if I run the following on either, I get the error;
stafford ~/git/grapple/src/core/swift$ ls
core core.xcodeproj
stafford ~/git/grapple/src/core/swift$ pod init
stafford ~/git/grapple/src/core/swift$ pod install
Analyzing dependencies
[!] Unable to find host target for Pods-core. Please add the host targets for the embedded targets to the Podfile.
[!] The Podfile does not contain any dependencies.
stafford ~/git/grapple/src/core/swift$
If, however, I make a new xcode project (single page application), I run the same commands above and the error does not occur.
Podfile generated FYI;
stafford ~/git/grapple/src/core/swift$ cat Podfile
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'core' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for core
end
stafford ~/git/grapple/src/core/swift$
@segiddins I think having "Pods-
@nvzqz what kind of target is Progression? Is it a framework? Extension?
@staff0rd what kind of target is core? Is it a framework? Extension?
@benasher44 Framework
Made it private to be released later and forgot I referenced it here. It's public again
@nvzqz Is Progression being consumed by another target in your project? CocoaPods is complaining that it can't find the target that's using your framework (error message could use improvement), so adding a line to your Podfile like this should fix it:
target 'TargetThatConsumesCore
I'm sorry but what do you mean by consuming core?
Er sorry I got target names confused. See the updated comment.
No, Progression is a standalone target with "Lazy macOS" as a dependency
I'm assuming that by consuming you're referring to having Progression as a dependency?
I see. Do you have a test target in the project? If so, adjusting your Podfile to look like this should fix it:
target 'Progression' do
pod 'Lazy', '~> 1.1.0'
target 'ProgressionTests' do
inherit! :search_paths
end
end
No I don't have any test targets yet
Gotcha. Adding one will satisfy CocoaPods for now and allow you to pod install. It's trying to find the consumer of your framework to install it and its dependencies (Lazy in this case) there, and then it's failing when their are no other targets that could be consumers of the framework in the Podfile.
@segiddins thoughts on supporting standalone framework targets without any host targets? Seems like we could support this if we can tell that there are no host targets in the project?
@benasher44 I guess we could just warn that the framework won't embed its dependencies?
Just to note, I also am experiencing a similar problem and @benasher44 comment to add a test target fixed it. Thank you!
I have a project that just has 3 frameworks for iOS, watchOS, and macOS. There isn't anything too magical going on and the project is set up pretty much like in this tutorial:
http://basememara.com/creating-cross-platform-swift-frameworks-ios-watchos-tvos-via-carthage-cocoapods/
I don't see too many faults with that approach and considering how CocoaPods has always been magical and easy to use, it would be nice for it to just handle the case without errors or having to do special things - if possible. I think this also used to work fine in 1.0.0.
@nvzqz @kgaidis @segiddins I'll have a look at lifting this restriction and just showing a warning in this scenario soon.
@nvzqz @kgaidis can you all have a look at the example messages in #5733 description? This PR makes framework-only dev situations only emit a warning (new message), and I've update the other message to be more verbose. Do you all these thinks messages are more clear?
Most helpful comment
I see. Do you have a test target in the project? If so, adjusting your Podfile to look like this should fix it: