0
votes

I realize this is a common error and has been asked several times but I am unable to resolve it after trying several different things based on others' answers.

I am creating a framework project (Obj-c) which uses another third-party framework. In MyFramework's umbrella header, I have the import statement of third-party framework. When I packaged my framework and included it in another iOS project, it fails to build with this error.

Things I tried:

  • Turned ON "Allow non-modular includes in Framework modules"
  • Added the umbrella header of the third-party framework as a "Public" header

Please advise what is missing here. Thanks in advance!

Here's the Exact Error:

Include of non-modular header inside framework module 'MyFramework.TestManager': '/TestApp/WindowsAzureMessaging.framework/Headers/WindowsAzureMessaging.h'

Also, from the path it looks like it is trying to search for it in the TestApp project, whereas it should refer from the Framework.

I imported the Azure Messaging Framework in the Umbrella header as shown below:

#import <WindowsAzureMessaging/WindowsAzureMessaging.h>
1
"In MyFramework's umbrella header, I have the import statement of third-party framework" that sounds really bad in the first place :) Why do you need that?battlmonstr
What is that 3rd-party framework? Is it a proper "modular" framework?battlmonstr
Well, initially I didn't have it. I actually have it in one of my other class header files. And when I packaged and got this error, I added it to the umbrella header too (still no luck).user591410
It is "WindowsAzureMessaging" framework.user591410
Could you also add an exact copy of your error message?battlmonstr

1 Answers

1
votes

I was able to reproduce your error. I looks like the WindowsAzureMessaging header and all other headers it refers are not made to be used in a modular framework umbrella header, because it uses "user" imports instead of "system" imports relative to the framework, and also it doesn't have the modulemap file.

You have several options:

  1. adapt their code and make it build as a module (make it "modular").
  2. not include it in the umbrella header (avoid referencing things from it there), but link it and use directly in the app and your framework.
  3. instead of using the file framework as a separate entity, you could take (copy) their source code (m and h files) and compile into your framework, and then expose some headers as your own headers.

I think that option 1 is the right way to go. It is not hard, and if you manage to do that, think about making a pull request for their repo, because this is going to benefit everyone.