0

I have created my own cocoa POD framework in swift, which uses #import CommonCrypto/CommonCrypto.h in Objective C bridging header file, but when I try to use same POD in project, It gives compile error -

Include of non-modular header inside framework module '': '/Users/macmini/Downloads/Xcode_9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk/usr/include/CommonCrypto/CommonCrypto.h'"

Please let me know how I can fix the same.

I am using this for creating my own POD framework in swift.

Abhijeet Barge
  • 562
  • 5
  • 21
  • https://stackoverflow.com/questions/25248598/importing-commoncrypto-in-a-swift-framework is a better duplicate. – David Berry Feb 09 '18 at 00:08

1 Answers1

0

Go to Project Target -> Build Settings -> search for "Modules" -> Set "Allow Non-modular Includes In Framework Modules" to Yes.

This will allow you to use Objective C bridging header file in your project.

  • 2
    Adding "Allow Non-modular Includes In Framework Modules" to YES, does not work. Still getting same error – Abhijeet Barge Feb 08 '18 at 06:17
  • Then you should try "@import CommonCrypto/CommonCrypto.h;" instead of "#import CommonCrypto/CommonCrypto.h" as both are potential workarounds but both breakdown under some cases. Converting to `@import` ceases to work if there are transitive dependencies. – Geeta Khati Feb 08 '18 at 06:32