I'm trying to resolve compiler flags, like -Wno-auto-import, in my main project. But I can't set the compiler flags for GoogleSignIn/Crashlytics/Firebase pods. I tried to add this following code to my Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['WARNING_CFLAGS'] = "$(inherited) -Wno-auto-import"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
end
end
end
But I'm still getting auto import compiler errors. It's working fine for facebook signin and all other pods. The compiler flags are also listed under Pods -> GTMOAuth2 -> Apple LLVM 9.0 - Custom Compiler Flags -> Other Warning Flags -> -Wno-auto-import
How do I fix this?
You are able to silence all cocoapod warnings by specifying this flag in your pod file:
inhibit_all_warnings!
You can be a bit more granular and specify it per pod if you wanted:
pod 'GoogleSignIn', inhibit_warnings: true
pod 'Crashlytics', inhibit_warnings: true
pod 'Firebase', inhibit_warnings: true
This may not work if you have -Weverything
enabled in your project, which is generally discouraged because it includes warnings that are buggy or still in development. This flag will give you false-positives for your cocoapod frameworks. More information here: https://softwareengineering.stackexchange.com/questions/122608/clang-warning-flags-for-objective-c-development/124574#124574
If you still wish to try manually edit the warning flags - then your code sample looks fine, make sure it's not getting overwritten by an xcconfig
file
Also make sure you do a clean so that no warnings are left over from previous builds! Xcode can be a pain and keep them around longer than they need to be sometimes. Check the actual build log produced to validate if they are still being raised