模块“myFramework"的伞头文件不包括标题“otherFramework.h" [英] umbrella header for module 'myFramework' does not include header 'otherFramework.h'

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

问题描述

我的 Swift/iOS9 框架 'viewer_protocol' 使用另一个外部 Objective-C 框架(

我在这里缺少什么?我在我的框架中使用了其他几个外部框架,它们没有任何警告 - 所有这些外部框架都是用 Swift 编写的 - CocoaAsyncSocket 是纯 Objective-C.

这是我的框架 module.modulemap:

 框架模块 my_project {伞头my_project.h"出口 *模块 * { 导出 * }}模块 viewer_protocol.Swift {标头my_project-Swift.h"}

更新

我找到了解决方案:从

更改我的框架标题中的导入语句

#import <CocoaAsyncSocket/CocoaAsyncSocket.h>

#import "CocoaAsyncSocket/CocoaAsyncSocket.h"

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

解决方案

我最近遇到了同样的问题.显然我在目标成员中将头文件设置为 public ,但它没有在伞头中公开.通过使用 project 访问而不是 public 来修复问题.

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.

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'

This is my framework header:

#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>

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

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.

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"
 }

Update

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

#import <CocoaAsyncSocket/CocoaAsyncSocket.h>

to

#import "CocoaAsyncSocket/CocoaAsyncSocket.h"

Now Xcode finds the header file and the warning disappears.

解决方案

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天全站免登陆