Podfile 包含框架或静态库目标,Podfile 不包含主机目标 [英] The Podfile contains framework or static library targets, for which the Podfile does not contain host targets

查看:62
本文介绍了Podfile 包含框架或静态库目标,Podfile 不包含主机目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近继承了一个有框架并使用 CocoaPods 的 iOS 项目.我正在尝试复制此设置,以便更好地理解.

I inherited an iOS project recently which has frameworks and uses CocoaPods. I'm trying to replicate this setup so I have a better understanding.

它有两个框架(作为 Xcode 项目),名为 RaterCommonRaterAPIKit.

It has two frameworks (as Xcode projects) named RaterCommon and RaterAPIKit.

这是其 Podfile 的最小化版本(我删除了不必要的部分).

Here's the minimized version of its Podfile (I removed unnecessary parts).

platform :ios, '10.0'

inhibit_all_warnings!
use_frameworks!

workspace 'Rater'

target :Rater do
    # various pods
end

target :RaterCommon do
    project 'Libraries/RaterCommon/RaterCommon.xcodeproj'
end

target :RaterAPIKit do
    project 'Libraries/RaterAPIKit/RaterAPIKit.xcodeproj'
end

运行 pod install 后,我收到此警告.

Upon running pod install, I get this warning.

Podfile 包含框架或静态库目标(RaterCommon、RaterAPIKit),Podfile 不包含主机目标(嵌入框架的目标).

The Podfile contains framework or static library targets (RaterCommon, RaterAPIKit), for which the Podfile does not contain host targets (targets which embed the framework).

而且我也无法在主项目的源代码中导入这些框架.即使在 Xcode 中的链接框架和库以及嵌入式二进制文件中添加它们之后.它说没有这样的模块.

And I can't import these frameworks inside my main project's source either. Even after adding them in Linked Frameworks and Libraries and Embedded Binaries in Xcode. It says No Such Module.

推荐答案

尝试在您拥有的每个目标或配置的框架搜索路径中添加您的框架路径 Libraries/RaterAPIKit/RaterAPIKit.xcodeproj.显示所有选项时,可以在构建设置中找到框架搜索路径.

Try adding your framework path Libraries/RaterAPIKit/RaterAPIKit.xcodeproj in Framework Search Paths for every target or configuration that you have. Framework Search Paths can be found inside Build Settings when showing all options.

这篇关于Podfile 包含框架或静态库目标,Podfile 不包含主机目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆