Podfile中包含框架或静态库目标,但是Podfile中没有包含主机目标。

6

最近我接手了一个iOS项目,它使用了框架并且使用了CocoaPods。我正在努力复制这个设置以便更好地理解它。

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

这是它的Podfile的简化版本(我删除了不必要的部分)。

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时,我收到了以下警告:

Podfile包含框架或静态库目标(RaterCommon, RaterAPIKit),但该Podfile未包含宿主目标(嵌入框架的目标)。

即使在Xcode中将它们添加到“链接的框架和库”和“嵌入式二进制文件”中,我仍然无法在我的主项目源中导入这些框架。它显示 "没有此模块"。


你的主应用程序有哪些目标? - Sachin Vas
3个回答

1

检查目标是否确实在该路径上

'Libraries/RaterCommon/RaterCommon.xcodeproj'
'Libraries/RaterAPIKit/RaterAPIKit.xcodeproj'

然后执行以下操作:

pod deintegrate && pod install

0

尝试将您的框架路径Libraries/RaterAPIKit/RaterAPIKit.xcodeproj添加到每个目标或配置的Framework Search Paths中。 当显示所有选项时,可以在Build Settings中找到Framework Search Paths。


0

将这些 pods 添加到使用这些框架的目标中。

例如-> 有一个示例应用程序使用这些 RaterCommon 和 RaterAPIKit 框架,因此您在这些目标中添加的任何 pods 也应该添加到示例应用程序中。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接