CocoaPods 遇到 A host target is a "parent" target which embeds a "child" target 问题解决

正在开发的项目中,集成RN,在使用cocoapods 时候,pod install 遇到如下问题:

[!] Unable to find host target(s) for sjyytExtension. 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)

发现:pod --version  1.5.3

解决:降低一个版本试下:

直接执行:pod _1.1.1_ install 

结果:OK

补充:在Podfile文件使用如下语法引用依赖库:

pod 'AFNetworking' //不显式指定依赖库版本,表示每次都获取最新版本
pod 'AFNetworking', '2.0' //只使用2.0版本
pod 'AFNetworking', '> 2.0' //使用高于2.0的版本
pod 'AFNetworking', '>= 2.0' //使用大于或等于2.0的版本
pod 'AFNetworking', '< 2.0' //使用小于2.0的版本
pod 'AFNetworking', '<= 2.0' //使用小于或等于2.0的版本
pod 'AFNetworking', '~> 0.1.2' //使用大于等于0.1.2但小于0.2的版本,不包含0.1.2
pod 'AFNetworking', '~>0.1' //使用大于等于0.1但小于1.0的版本
pod 'AFNetworking', '~>0' //高于0的版本,写这个限制和什么都不写是一个效果,都表示使用最新版本

猜你喜欢

转载自www.cnblogs.com/richard-youth/p/10335435.html
今日推荐