Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 615 Vote(s) - 3.57 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Include of non-modular header inside framework module

#11
Actually an easier way to fix this is to move the `#import` statement to the top of the `.m` file instead (instead of having it in your `.h` header file). This way it won't complain that it's including a non-modular header file. I had this problem where `Allow non-module includes` set to `YES` did ***NOT*** work for me, so by moving it to the implementation file, it stopped complaining. This is in fact the preferred way of importing and including header files anyway. Once you've done this, setting this back to `NO` should work.

Ideally we should try and aim to have `Allow non-module includes` set to `NO`. Setting this to `YES` in most cases means you're doing something wrong. The setting translates to "Allow importing random header files on disk that aren't otherwise part of the module". This applies to a very few use cases in practice, and so this setting should always be `NO` (i.e. the default value).
Reply

#12
I ended up moving the Umbrella Header to bottom of the Headers list after checking the above solutions, and that worked in Xcode 9.3.
Reply

#13
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 `CoreLibrary.framework`) & Delete `Modules` folder.

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

#14
In my case I forgot to add .h and .m file in .podspecs file's "s.source_files" section.

after adding this in it work fine.

[![enter image description here][1]][1]


[1]:
Reply

#15
I came across this issue as well and originally thought it was a CocoaPods issue, but it was an issue in the apps build settings where someone (probably me) had set `${PODS_ROOT}` in Header Search Paths and set it to be a `recursive` search. This was allowing it to find headers that were not intended to be used when building the app. Once I set this to use `non-recursive` everything was fine. using `recursive` search is a terrible hack to try to find the proper headers. Lesson learned.
Reply

#16
`Allow Non-modular Includes in Framework Modules` only work in objc code. not work in swift.

After a period of research, I found that swift can pass warning parameter to clang, so set `OTHER_SWIFT_FLAGS` to `-Xcc -Wno-error=non-modular-include-in-framework-module` inhibit swift import error.

just for someone who have same problem
Reply

#17
try `@import FrameworkName` instead of `#import "FrameworkName.h"`
Reply

#18
I was having a similar problem! When running my app target, everything was working fine, but when changing to test target and trying to run the tests, "Include of non-modular header inside framework module" error showed up. I tried all the solutions posted here but none of them worked. At the end I scrolled over all build settings and for each one that was related to headers I read the description.

Switching `USE_HEADERMAP` to `NO` did the trick!

I hope anyone could find this helpful!
Reply

#19
**In case if you are developing your own framework:**

**WHY is this happening?**

If any of the public header files you have mentioned in your **module.modulemap** have import statements that are **not** mentioned in modulemap, this will give you the error. Since it tries to import some header that is not declared as modular (in module.modulemap), it breaks the modularity of the framework.

**HOW can I fix it?**

Just include the header that gave the error to your module.modulemap and build again!

**WHY NOT just set allow non-modular to YES?**

Because it's not really a solution here, with that you tell your project "this framework was supposed to be modular but it's not. Use it somehow, I don't care." This doesn't fix your library's modularity problem.

For more information check this [archived blog post][1] or refer to [clang docs][2].


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#20
I had this problem when I added Swift source code to an existing ObjC static framework (dynamic framework with Mach-O type "Static Library").

The fix was setting `CLANG_ENABLE_MODULES` ("Enable Modules" in build settings) to `YES`
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through