4

I am making a open-source library in Swift, it uses a third-party library (MailCore) which is itself in Obj-C so I added a bridging-header in my library.

The library is itself working fine when I run in my example project but when I try to use it as a CocoaPod in a Swift project then the compiler shows the following error:

Include of non-modular header inside framework module 'MyLib.MyLib_Bridging_Header': 'path/to/my/otherProject/Pods/Headers/Public/mailcore2-ios/MailCore/MailCore.h'

P.S - I am using my library in a Swift project using cocoa pods using use_frameworks!

Can you please help me in solving this issue?

Edit :

I have no intention to make it as a framework , this question is regarding the frameworks.

SandeepAggarwal
  • 1,273
  • 3
  • 14
  • 38
  • Possible duplicate of [Swift compiler error: “non-modular header inside framework module”](https://stackoverflow.com/questions/24103169/swift-compiler-error-non-modular-header-inside-framework-module) – l'L'l Jul 14 '17 at 16:23
  • @https://stackoverflow.com/users/499581/lll I have no intention to make it as a framework , this question is regarding the frameworks. – SandeepAggarwal Jul 17 '17 at 08:18
  • If you have no intention of making it a framework why would do "use_frameworks!" in CocoaPods? – l'L'l Jul 17 '17 at 09:21
  • 3
    because Swift project requires use of "use_frameworks!" – SandeepAggarwal Jul 17 '17 at 09:28

1 Answers1

2

I solved it removing Modules folder from the framework.

  • Browse to your framework location which is present in the App Project using finder

  • Go inside Test.framework folder (In the above case it will be MailCore.framework) & Delete Modules folder.

  • Clean and Re Build the app, it will solve the problem.

Vittal Pai
  • 3,317
  • 25
  • 36