Albert Renshaw
Albert Renshaw

Reputation: 17902

Xcode 12, How to suppress "Double-quoted include in framework header" warnings throughout entire project

With Xcode 12 there is a new default warning which will throw a warning anywhere you #import or #include with "quotes.h" instead of <brackets.h>.

Warning: "Double-quoted include in framework header"

How do you turn off this warning for the entire project?

Upvotes: 30

Views: 20657

Answers (9)

Hogdotmac
Hogdotmac

Reputation: 349

had this error in Version 15.4 (15F31d) none of the above worked, the problem was "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/modules-verifier" ignored all of that.

the only solution was to patch the offending files in the post install hook

post_install do |installer|
    %x(patch "Pods/Target Support Files/<offending module>/<offending module>-umbrella.h" < "patches/fix.patch")
end

and creating the patch with

diff "<offending module>-umbrella.h" "new-umbrella.h" > "patches/fix.patch"

after you fixed all the imports with:

#import "whatever.h"
to
#import <Module/whatever.h>

Upvotes: 0

Greg Brown
Greg Brown

Reputation: 3254

I started seeing these errors with the release build of Xcode 16. I was able to resolve the issue by setting "Enable Module Verifier" to "No" in the build settings.

Upvotes: 2

yoojinwb
yoojinwb

Reputation: 1

  1. Comment all pods in Podfile and run pod install
  2. Remove Podfile and Podfile.lock
  3. flutter clean
  4. flutter build ios

This worked for me.

Upvotes: -2

thebiggestlebowski
thebiggestlebowski

Reputation: 2779

In addition to the suggestion by @Silas to set this property in XCode: CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO

I also had to manually set to NO by do the search and replace below. Not sure why XCode didn't do this for me when I changed it in the XCode IDE.

CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES -> NO

Upvotes: 0

Naloiko Eugene
Naloiko Eugene

Reputation: 2626

I was adding the Objective C files to XCFramework. This code

 #import "BlaBla.h"

was causing the issue: "double-quoted include "BlaBla.h" in framework header, expected angle-bracketed instead".

I was trying to change it to #import <BlaBla.h> - but as well no success.

It seems I've figured out that I need to append the module name as well:

#import <ModuleName/BlaBla.h>

And this allowed me to build the XCFramework.

Upvotes: 8

Silas
Silas

Reputation: 981

I think a simpler way is to go in the project's Build Settings a just set the option "Quoted Include In Framework Header" CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER to No :

enter image description here

Upvotes: 38

Serhii Didanov
Serhii Didanov

Reputation: 2348

I have the same issue in Xcode 14, and solution above does not helps me. helps this steps:

  1. Comment all pods in Podfile and run pod install
  2. Remove Pods directory
  3. pod install
  4. Uncomment all pods and run pod install

Upvotes: 2

iHS
iHS

Reputation: 5432

Looks like this issue is fixed as part of Cocoapods 1.10.1 (not officially released, as of this writing). However, you can use Cocoapods version 1.10.0.rc.1 temporarily until 1.10.1 is officially available.

gem install cocoapods -v '1.10.0.rc.1'

Another option is to update your Podfile (add below code) to disable the warning flag CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER setting for all pods in your project.

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
          config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
      end
    end
  end
end

Upvotes: 5

Albert Renshaw
Albert Renshaw

Reputation: 17902

You can disable these warnings for your entire project by navigating to your project's "build settings", finding the field "other linker flags" and adding the following flag:

-Wno-quoted-include-in-framework-header

Upvotes: 7

Related Questions