The target ... overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig
Solution 1:
This definitely works most of the time:
Go to your target Build Settings -> Other linker flags -> double click . Add $(inherited)
to a new line.
If you have problem with "...target overrides the GCC_PREPROCESSOR_DEFINITIONS build setting defined in..." then you must add $(inherited) to your target Build Settings -> Preprocessor Macros
Solution 2:
There is a conflict between your build settings and the default build settings that Cocoapods wants. To see the Cocoapods build settings, view the .xcconfig file(s) in Pods/Target Support Files/Pods-${PROJECTNAME}/ in your project. For me this file contains:
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/Commando"
OTHER_LDFLAGS = -ObjC -framework Foundation -framework QuartzCore -framework UIKit
PODS_ROOT = ${SRCROOT}/Pods
If you are happy with the Cocoapods settings, then go to Build Settings for your project, find the appropriate setting and hit the Delete key. This will use the setting from Cocoapods.
On the other hand, if you have a custom setting that you need to use, then add $(inherited) to that setting.
Solution 3:
I've seen these 3 errors for pod command in terminal
pod install
[!] The MY_APP [Debug/Release] target overrides the HEADER_SEARCH_PATHS ...
[!] The MY_APP [Debug/Release] target overrides the OTHER_LDFLAGS ...
[!] The MY_APP [Debug/Release] target overrides the GCC_PREPROCESSOR_DEFINITIONS ...
All these 3 errors would be gone by adding $(inherited) to
- Header Search Paths
- Other Linker Flags
- Preprocessor Macros
in Project -> Target -> Build Settings
And now the command would run without giving any errors
pod install
Solution 4:
Just had a similar issue when I ran pod install
, I saw the following warnings/errors (related to CLANG_CXX_LIBRARY
):
The Error/Warning from Cocoapods
[!] The `Project [Debug]` target overrides the `CLANG_CXX_LIBRARY` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `Project [Release]` target overrides the `CLANG_CXX_LIBRARY` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
The Fix
- Select your
Project
so you can see theBuild Settings
. - Select your
Target
(AppName
underTargets
) - Find
C++ Standard Library
(It will probably be in BOLD - This means it's overridden). - Select the Line (So it's highlighted Blue), and press ⌘ + DELETE (Command + Backspace)
The line should not be bolded anymore and if you run pod install
the warnings/errors should have disappeared.
Visual Aid
Solution 5:
In your project, find Target -> Build Settings -> Other Linker Flags
, select Other Linker Flags
, press delete
(Mac Keyboard)/Backspace
(Normal keyboard) to recover the setting. It works for me.
Example:
Before
After