19

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?

Albert Renshaw
  • 17,282
  • 18
  • 107
  • 195

6 Answers6

25

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

marc-medley
  • 8,931
  • 5
  • 60
  • 66
Silas
  • 813
  • 1
  • 10
  • 18
  • Even better! Thanks – Albert Renshaw Sep 21 '20 at 14:19
  • Yes agree, this wa my solution! :) Even if inside pods every time you perform `pod install`, the `project update` suggests the update. – arcangel06 Sep 22 '20 at 10:45
  • I am a long-time linux/java/javascript developer who does most everything command-line. Since developing cross-platform I am finding the Apple way of doing things very frustrating and use fastlane for all my deploying. Can someone please explain to me how to do this without the XCode GUI? I have a build.xcconfig file but have no idea how to set this in there. Also, I did try opening my project in XCode but I don't see this setting anyway. Cheers. – crowmagnumb Oct 12 '20 at 23:32
  • 3
    UPDATE: I did find the setting but it was under All - Combined (not Basic - Combined) as the above screenshot shows. It is set to "No" yet I am getting this warning with every Pod in my project and it swamps my output so I can't find the actual problem I'm having. Sigh. – crowmagnumb Oct 12 '20 at 23:35
  • @crowmagnumb Maybe try my original solution to see if it works on your pods too: https://stackoverflow.com/a/63947318/2057171 – Albert Renshaw Dec 15 '20 at 09:08
  • Our project uses Xcode Configuration Settings (`.xcconfig`) and Apple Docs say *Warns when a quoted include is used instead of a framework style include in a framework header.* `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO` – RobLabs Aug 31 '21 at 05:42
5

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
iHS
  • 5,372
  • 4
  • 31
  • 49
4

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

Albert Renshaw
  • 17,282
  • 18
  • 107
  • 195
  • 2
    Note: When the warning is thrown if you right click on the warning and select 'Reveal in log' you will be presented with the warning in `-Waaa-bbb-ccc` format, with any warning you can change this to `-Wno-aaa-bbb-ccc` and add as a linker flag to suppress project wide. – Albert Renshaw Sep 17 '20 at 23:27
  • Not working for me on Xcode 12 (latest build). -Wno-quoted-include-in-framework-header -Wquoted-include-in-framework-header – arcangel06 Sep 18 '20 at 09:37
  • @arcangel06 you must only use the one starting with `-Wno-` ; sometimes with linker flags I have to quit xCode and relaunch for them to take effect but most of the time it works the very next build. – Albert Renshaw Sep 18 '20 at 22:42
  • Sadly, it doesn't work for FaceBook SDK includes – JeffB6688 May 18 '21 at 20:35
  • 1
    @JeffB6688 Make sure you clean project, quit and relaunch xcode and wait a minute for files to all be re-scanned by optimizer. Facebook SDK is likely very large and takes a bit for refresh to occur in background task – Albert Renshaw May 18 '21 at 21:35
  • @AlbertRenshaw Yeah, I tried that. I just can't get rid of these warnings. – JeffB6688 May 20 '21 at 14:50
0

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.

Naloiko Eugene
  • 2,453
  • 1
  • 28
  • 18
-1

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
Serhii Didanov
  • 2,200
  • 1
  • 16
  • 31
-1

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

thebiggestlebowski
  • 2,610
  • 1
  • 33
  • 30
  • Not sure why I got down voted. Didn't work for me until I did this. I'll pay the two point penalty by keeping my answer here in the hopes that it helps someone. Would love to know what was wrong with my answer. – thebiggestlebowski Aug 29 '23 at 21:54