在框架模块中包含 non-modular header - Xcode 9.2

Include of non-modular header inside framework module - Xcode 9.2

当我尝试在我的框架中使用 pod 安装 google 分析时,该 pod 已成功添加到我的框架项目中。但是当我试图在我的框架伞 header 中导入 #import <Google/Analytics.h> 时,我得到了这个错误。我正在使用 Xcode 9.2,我的框架内置于 swift.

首先,select 将 GoogleAnalytics SDK 文件夹拖放到框架应用程序中。然后在 Build Phases-> Headers-> public.

中添加所有 .h 文件作为 public

并且您还需要在 General ->

中添加以下支持框架
Embedded Binaries:
SystemConfiguration.framework
CoreData.framework
ImageIO.framework
libz.tbd
libsqlite3.tbd
libGoogleAnalytics.a

已清理并 运行 构建您的框架项目,它将 运行 成功。