模块"myFramework"的伞头不包含头"otherFramework.h" [英] umbrella header for module 'myFramework' does not include header 'otherFramework.h'

查看:114
本文介绍了模块"myFramework"的伞头不包含头"otherFramework.h"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Swift/iOS9框架"viewer_protocol"使用了另一个外部Objective-C框架( CocoaAsyncSocket ) .我正在使用迦太基构建CocoaAsyncSocket.到目前为止,一切都很好:在使用我的框架的框架Xcode Project中有一个示例应用程序,没有任何问题.

My Swift / iOS9 framework 'viewer_protocol' uses another and external Objective-C framework (CocoaAsyncSocket). I'm using Carthage to build CocoaAsyncSocket. So far everything works fine: In have an example App inside my framework Xcode Project using my framework without any problems.

现在,我想在另一个Xcode项目中使用我的框架-尽管使用了迦太基.我只包含我的框架作为依赖项,而迦太基自动将依赖项解析为CocoaAsyncSocket.我将两个框架都嵌入到这个新的Xcode项目中,并构建了我的App:此处一切正常-除了一个我不能摆脱的警告:

Now I want to use my Framework in a different Xcode Project - although using Carthage. I include only my Framework as a dependency and Carthage automatically resolves the dependencies to CocoaAsyncSocket. I embedded both frameworks into this new Xcode Project and build my App: Everything works fine here - except one warning I can't rid off:

/Users/John/Repositories/my_project/<module-includes>:1:1: 
Umbrella header for module 'my_project' does not include header 'GCDAsyncSocket.h'

这是我的框架标题:

#import <UIKit/UIKit.h>

//! Project version number for my_project.
FOUNDATION_EXPORT double my_projectVersionNumber;

//! Project version string for my_project.
FOUNDATION_EXPORT const unsigned char my_projectVersionString[];

// In this header, you should import all the public headers of your framework     
using statements like #import <my_project/PublicHeader.h>
#import <CocoaAsyncSocket/CocoaAsyncSocket.h>

您可以看到CocoaAsyncSocket.h已导入.此外,在我的框架内还包含CocoaAsyncSocket.h文件:

As you can see CocoaAsyncSocket.h is imported. Furthermore inside my framework the CocoaAsyncSocket.h file is included:

我在这里想念的是什么?我在框架内使用了其他几个外部框架,没有警告-所有这些外部框架都是用Swift编写的-CocoaAsyncSocket是纯Objective-C.

What I am missing here? I'm using several others external frameworks inside my framework, there're no warnings for them - all of these external frameworks are written in Swift - CocoaAsyncSocket is pure Objective-C.

这是我的框架module.modulemap:

This is my frameworks module.modulemap:

 framework module my_project {
   umbrella header "my_project.h"

   export *
   module * { export * }
 }

 module viewer_protocol.Swift {
     header "my_project-Swift.h"
 }

更新

我找到了一个解决方案:更改框架标题中的import语句

I found a solution: Changing the import statement in my framework header from

#import <CocoaAsyncSocket/CocoaAsyncSocket.h>

#import "CocoaAsyncSocket/CocoaAsyncSocket.h"

现在Xcode找到了头文件,警告消失了.

Now Xcode finds the header file and the warning disappears.

推荐答案

我最近遇到了同样的问题.显然我在目标成员身份中将头文件设置为public,但未在伞形头中公开.通过使用具有project而不是public权限的头文件来解决此问题.

I recently ran into same issue. Apparently I had header file set as public in target membership, but it was not exposed in umbrella header. Fixed issue by making header file with project access instead of public.

这篇关于模块"myFramework"的伞头不包含头"otherFramework.h"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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