objective-c 目标覆盖 FRAMEWORK_SEARCH_PATHS 构建设置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26445784/
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-03 21:29:23  来源:igfitidea点击:

target overrides the FRAMEWORK_SEARCH_PATHS build settings

objective-ccocoapods

提问by Peter Brockmann

I'd like to ask and then answer this question.

我想问然后回答这个问题。

I'd like to update the CocoaPods built into my app, so I ran pod installfrom the terminal.

我想更新我的应用程序中内置的 CocoaPods,所以我pod install从终端运行。

That's when I got this error:

那是我收到此错误的时候:

[!] The `APP_NAME [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` 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.

How do you Use the $(inherited) flag?

你如何使用 $(inherited) 标志?

回答by Peter Brockmann

Selected the Project, targets-> app, then Build Settingswhere I added the $(inherited) line, deleting whatever specific pod had been referenced there before:

选择项目,目标-> 应用程序,然后Build Settings在其中添加 $(inherited) 行,删除之前在那里引用的任何特定 pod:

enter image description here

在此处输入图片说明

I hope this helps someone.

我希望这可以帮助别人。

回答by dsapalo

I was encountering this issue as well.

我也遇到了这个问题。

Aside from doing what Peter mentioned above, remember to double check if the correct Xcode project is selected in your podfile. This is because it is possible that you are changing the Build Settings of the incorrect Xcode project. It was a silly mistake, but it took quite some time before I realized it.

除了执行 Peter 上面提到的操作之外,请记住仔细检查您的 podfile 中是否选择了正确的 Xcode 项目。这是因为您可能正在更改不正确的 Xcode 项目的构建设置。这是一个愚蠢的错误,但我花了很长时间才意识到这一点。

Normally, pod installworks automatically if there is only one .xcodeprojfile in the directory. However, if you are migrating your project to begin using cocoapods from the old way of manually adding frameworks/3rd party projects to your Xcode project, it is possible that you will have multiple .xcodeproj files in your folder. Doing the abovementioned fix didn't solve it for me, because I was editing the incorrect .xcodeprojfile.

通常,pod install如果.xcodeproj目录中只有一个文件,则自动工作。但是,如果您正在迁移您的项目以开始使用 cocoapods 从手动添加框架/第 3 方项目到您的 Xcode 项目的旧方式,您的文件夹中可能会有多个 .xcodeproj 文件。进行上述修复并没有为我解决问题,因为我正在编辑不正确的.xcodeproj文件。

Go to your project directory, check the file named Podfileand make sure you specify the xcodeproj:

转到您的项目目录,检查命名的文件Podfile并确保您指定xcodeproj

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift

use_frameworks!
xcodeproj 'APP_NAME.xcodeproj'
target 'APP_NAME' do

# Your dependencies here
# pod 'NAME_OF_DEPENDENCY'
pod 'Google/CloudMessaging'
pod 'RxSwift',    '~> 2.0'
pod 'RxCocoa',    '~> 2.0'
pod 'RxBlocking', '~> 2.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'

After selecting the correct .xcodeprojon your Podfile, go to Xcode and do the following:

.xcodeprojPodfile 上选择正确的之后,转到 Xcode 并执行以下操作:

  1. From the Project Navigator on the left side, select your project.
  2. On the center screen, go to Build Settings
  3. Add a filter for 'Framework Search Paths'
  4. Enter $(inherited)as the value; it should auto-fill with data evaluating that expression
  1. 从左侧的项目导航器中,选择您的项目。
  2. 在中央屏幕上,转到 Build Settings
  3. 为“框架搜索路径”添加过滤器
  4. 输入$(inherited)作为值;它应该自动填充评估该表达式的数据

Below is an image of Xcode with Version 7.2 (7C68).

下面是版本 7.2 (7C68) 的 Xcode 图像。

Xcode preview

Xcode 预览