XCode 6 CocoaPods 错误:目标覆盖了`OTHER_LDFLAGS` 构建设置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26439856/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:54:41  来源:igfitidea点击:

XCode 6 CocoaPods error : target overrides the `OTHER_LDFLAGS` build setting

iosobjective-cxcodecocoapods

提问by leenyburger

I just starting using CocoaPods and I am getting the following errors when I pod install from the terminal (My project is called babyMilestones and I'm trying to use CocoaPods for the ShipLib Framework). :

我刚开始使用 CocoaPods,当我从终端安装 pod 时出现以下错误(我的项目名为 babyMilestones,我正在尝试将 CocoaPods 用于 ShipLib 框架)。:

The babyMilestones [Release]target overrides the FRAMEWORK_SEARCH_PATHSbuild 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.

babyMilestones [Release]目标将覆盖FRAMEWORK_SEARCH_PATHS中定义的构建设置Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the$(继承)'标志,或者-从目标中删除构建设置。

I'm getting this error for Header Search Paths and Framework Search Paths.

我收到标题搜索路径和框架搜索路径的错误。

When I try to build my project I get an error on the #import line saying the ShipLib/ShipLib.h file cannot be found. In my project navigator my Pods project is showing properly, and the ShipLib framework is visible.

当我尝试构建我的项目时,我在 #import 行上收到一条错误消息,指出找不到 ShipLib/ShipLib.h 文件。在我的项目导航器中,我的 Pods 项目显示正确,并且 ShipLib 框架可见。

I never set any of these search paths explicitly, I just let XCode 6 do it's thing. I found this answer : The target ... overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfigI have tried the following :

我从未明确设置任何这些搜索路径,我只是让 XCode 6 来做这件事。我找到了这个答案:目标......覆盖了`Pods/Pods.xcconfig中定义的`OTHER_LDFLAGS`构建设置我尝试了以下操作:

  1. Deleted all the Framework Search Paths in Build Settings. This did not fix the issue enter image description here

  2. I then added $(inherited) to the Framework Search Path. I did Clean then Build. This gave new errors of the following type:

    ld: warning: directory not found for option '-L/Users/billpaystation/Documents/iOS/babyMilestones/babyMilestones/Pods/build/Debug-iphoneos' ld: warning: directory not found for option '-F' Undefined symbols for architecture i386: "_OBJC_CLASS_$_ActionSheetDatePicker", referenced from: objc-class-ref in EditItemViewController.o "_OBJC_CLASS_$_SYSincerelyController", referenced from: objc-class-ref in EditItemViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

  1. 删除了构建设置中的所有框架搜索路径。这没有解决问题 enter image description here

  2. 然后我将 $(inherited) 添加到框架搜索路径。我先清理然后构建。这产生了以下类型的新错误:

    ld:警告:找不到选项“-L/Users/billpaystation/Documents/iOS/babyMilestones/babyMilestones/Pods/build/Debug-iphoneos”的目录 ld:警告:找不到选项“-F”的目录未定义的架构符号i386:“_OBJC_CLASS_$_ActionSheetDatePicker”,引用自:EditItemViewController.o 中的 objc-class-ref “_OBJC_CLASS_$_SYSincerelyController”,引用自:EditItemViewController.o 中的 objc-class-ref:未找到架构 i386 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Action Sheet Picker and Sincerely Controller are the libraries I'm trying to add with Pods.

Action Sheet Picker 和Sincerely Controller 是我想用Pods 添加的库。

  1. I noticed that libPods.a is red under Frameworks in my file inspector. So I went to Scheme ->Edit Scheme-> and added Pods to the Build. enter image description hereI don't really understand the whole target/build settings and I may have made it worse trying so many different things. Any help would be appreciated!
  1. 我注意到 libPods.a 在我的文件检查器中的 Frameworks 下是红色的。所以我去了 Scheme -> Edit Scheme-> 并将 Pod 添加到 Build 中。 enter image description here我不太了解整个目标/构建设置,而且我尝试了这么多不同的东西可能会使情况变得更糟。任何帮助,将不胜感激!

采纳答案by euthimis87

You should add $(inherited) to the Framework Search Path. For the new errors you should go:

您应该将 $(inherited) 添加到框架搜索路径。对于新的错误,你应该去:

TargetSettings->Build Phases->Compile Sources->(+) ActionSheetDatePicker.m, and SYSincerelyController.m classes and then Build and Run.

TargetSettings->Build Phases->Compile Sources->(+) ActionSheetDatePicker.m 和 SYSincerelyController.m 类,然后构建并运行。

回答by Peter Brockmann

Here's my problem and solution from yesterday.

这是我昨天的问题和解决方案。

target overrides the FRAMEWORK_SEARCH_PATHS build settings

目标覆盖 FRAMEWORK_SEARCH_PATHS 构建设置

Hope this helps.

希望这可以帮助。

回答by Maciek Czarnik

In my case it was not an Xcode issue, plus I think that fixing it by hand is a bad idea. I tried to use a different (earlier version) of Cocoapods and it worked fine!

就我而言,这不是 Xcode 问题,而且我认为手动修复它是个坏主意。我尝试使用不同(早期版本)的 Cocoapods,效果很好!

gem install cocoapods -v 0.33.1

gem install cocoapods -v 0.33.1