Xcode10执行pod init/pod install时遇OTHER_LDFLAGS覆盖错误求助
OTHER_LDFLAGS Override Error in Xcode 10 Hey there, I’ve dealt with this exact CocoaPods error in Xcode 10 before, so I know how frustrating it can be. Let’s break down what’s happening and how to fix it quickly.
The error message is letting you know that your UZApp target’s OTHER_LDFLAGS build setting is overriding the one defined in the CocoaPods-generated xcconfig files. This breaks CocoaPods’ ability to properly link your dependencies, so we need to resolve this conflict with one of two simple methods.
Method 1: Use the $(inherited) Flag (Recommended)
This approach lets you keep any custom linker flags you’ve set while also pulling in the ones that CocoaPods needs. Here’s the step-by-step:
- Open your Xcode project, then select the
UZApptarget from the left sidebar. - Switch to the Build Settings tab.
- Use the search bar to look up
Other Linker Flags(this is the human-readable name forOTHER_LDFLAGS). - For both the Debug and Release configurations:
- Double-click the value field to open the multi-line editor.
- Add a new line at the very top and type
$(inherited) - Make sure any custom flags you had previously are still present below this line
- Save your project changes, then head back to the terminal and re-run
pod install.
Method 2: Remove the Overriding Build Setting
If you don’t have any custom linker flags that you need to preserve, you can just clear the setting entirely and let CocoaPods handle it:
- In the same Build Settings tab for
UZApp, findOther Linker Flags. - For both Debug and Release configurations, delete all values in the field (leave it empty).
- Save your project, then run
pod installagain in the terminal—CocoaPods will automatically apply the correct flags from its generated xcconfig files.
Pro tip: Going forward, try to use $(inherited) for any build settings that CocoaPods manages (like HEADER_SEARCH_PATHS or FRAMEWORK_SEARCH_PATHS)—this will help avoid similar conflicts down the line.
内容的提问来源于stack exchange,提问作者china-primary school student

