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

#1
I am using Xcode 6,

1) Firstly I am creating a dynamic library (CoreLibrary). This library contain RequestPoster.h file.

2) Then I create a Cocoa Touch Framework and added this dynamic library (CoreLibrary).

3) Then this framework is add on my project and it gives error in RequestPoster.h file (CoreLibrary).

Error : Include of non-modular header inside framework module
class :

ifaddrs.h, arpa/inet.h, sys/types.h>

These file not found in the project.

Reply

#2
You can set **Allow Non-modular includes in Framework Modules** in Build Settings for the affected target to YES. This is the build setting you need to edit:

[![Build Settings item you need to edit][1]][1]

**NOTE**: You should use this feature to uncover the underlying error, which I have found to be frequently caused by duplication of angle-bracketed global includes in files with some dependent relationship, i.e.:

#import <Foo/Bar.h> // referred to in two or more dependent files

If setting **Allow Non-modular includes in Frame Modules** to **YES** results in a set of "X is an ambiguous reference" errors or something of the sort, you should be able to track down the offending duplicate(s) and eliminate them. After you've cleaned up your code, set **Allow Non-modular includes in Frame Modules** back to **NO**.


[1]:
Reply

#3
"Include of non-modular header inside framework module"

When you get this error the solution in some circumstances can be to simply to mark the file you're trying to import as "public" in the file inspector "Target Membership". The default is "Project", and when set this way it can cause this error. That was the case with me when trying to import Google Analytic's headers into a framework, for example.
Reply

#4
I had the same issue and nothing from above helped me. So I hope my answer will be helpful for somebody. In my case the problem was in ALWAYS_SEARCH_USER_PATHS setting. When it was set to NO project built and worked ok. But as far as one of the pod required it to be set to YES I was receiving an error

> Include of non-modular header inside framework module

After couple cups of coffee and all day researching I found out that according to known issues of [Xcode 7.1 Beta 2 release notes][1]:

> • If you get an error stating "Include of non-modular header inside
> framework module" for a framework that previously compiled, make sure
> the "Always Search User Paths" build setting is set to "No". The
> default is "Yes" only for legacy reasons. (22784786)

I was using XCode 7.3 though, but seems like this bug hasn't been fixed yet.


[1]:
Reply

#5
This was kind of an annoying issue for me. No suggestions seemed to help my particular case, since I needed to include the "non-modular" headers in my individual file header file. The work around I used was sticking the import call in the prefix header file.
Reply

#6
I had the same problem and solve it by just making header file public.
![[problem]][1]


If you are working on multiple modules in your project. Then your header file needs to be public to be used in other parts of projects. What you need is to select that header file, and in project Utilities view. Change the file from Project/Private to Public. See image below:

[![Changing header file scope][2]][2]


[1]:

[2]:
Reply

#7
If you need this for CocoaPods targets add this lines in `Podfile`:

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
target.build_settings(config.name)['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
end
end
end
Reply

#8
Try going Build Settings under "Target" and set "Allow Non-modular Includes in Framework Modules" to YES.

The real answer is that the location of the imports needs to be changed by the library owner. Those files ifaddrs.h, arpa/inet.h, sys/types.h are getting imported in a .h file in a framework, which Xcode doesn't like. The library maintainer should move them to a .m file. See for example this issue on GitHub, where AFNetworking fixed the same problem:

[To see links please register here]

Reply

#9
If you see this error in an **umbrella header** when building a **dynamic framework**, make sure you import your file as:

`#import "MyFile.h"`

and **not** as `#import <MyFramework/MyFile.h>`.
Reply

#10
I was able to clear dozens of these errors by using Git clean. Here's the command: `git clean -dffx && git reset --hard`
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

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