Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

“Include of non-modular header inside framework module” while compiling pod

I am creating a pod that uses RestKit and a bunch of other pods.

When I am compiling my pod with the command :

pod repo push myCocoapodsRepo myPodspec.podspec --allow-warnings --verbose

The first error I get is

In file included from /var/folders/mx/cg3cmvh14wl2f3mnq0sc_cd00000gn/T/CocoaPods/Lint/Pods/RestKit/Code/ObjectMapping.h:21:
/var/folders/mx/cg3cmvh14wl2f3mnq0sc_cd00000gn/T/CocoaPods/Lint/Pods/RestKit/Code/ObjectMapping/RKObjectMapping.h:23:9: error: include of non-modular header inside framework module 'RestKit.RKObjectMapping' [-Werror,-Wnon-modular-include-in-framework-module]
#import "RKValueTransformers.h"
    ^

If I rely on other StackOverflow threads about this error, like

  • Swift compiler error: "non-modular header inside framework module"
  • Include of non-modular header inside framework module
  • XCode6: Receiving error "Include of non-modular header inside framework module"

They will all say that setting CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES to YES and/or placing the problematic header file in the Public section instead of the Project section, it will solve the problem. But for me, it does not. Those threads also have in common the Swift language, but I do not use it. I'm still using only Objective-C, but I don't know if it has an impact on my problem.

I do not understand what the error means, therefore I have a lot of difficulty solving the problem. Does someone have another solution?

like image 765
Raphael Royer-Rivard Avatar asked May 25 '15 15:05

Raphael Royer-Rivard


1 Answers

You should add the flag --use-libraries like this:

pod repo push myCocoapodsRepo myPodspec.podspec --allow-warnings --verbose --use-libraries
like image 172
SalvoC Avatar answered Sep 28 '22 14:09

SalvoC