target会覆盖FRAMEWORK_SEARCH_PATHS构建设置

Pet*_*ann 51 objective-c cocoapods

我想问一下然后回答这个问题.

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

那是我收到这个错误的时候:

[!] 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.
Run Code Online (Sandbox Code Playgroud)

你如何使用$(继承)标志?

Pet*_*ann 107

选择项目,目标 - >应用程序,然后Build Settings我添加了$(继承)行,删除之前引用的任何特定pod:

在此输入图像描述

我希望这可以帮助别人.

  • 谢谢。我不得不删除指定的 pod,并用您提到的 $(inherited) 替换它。 (2认同)
  • 在我的情况下,我需要添加$(PROJECT_DIR) (2认同)

iwi*_*not 14

我也遇到了这个问题.

除了做上面提到的Peter之外,记得仔细检查你的podfile中是否选择了正确的Xcode项目.这是因为您可能正在更改不正确的Xcode项目的Build Settings.这是一个愚蠢的错误,但在我意识到它之前花了很长时间.

通常,pod install如果.xcodeproj目录中只有一个文件,则自动工作.但是,如果要迁移项目以开始使用cocoapods从旧的方式手动将框架/第三方项目添加到Xcode项目中,则可能在文件夹中有多个.xcodeproj文件.执行上述修复并没有解决它,因为我正在编辑不正确的.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'
Run Code Online (Sandbox Code Playgroud)

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

  1. 从左侧的Project Navigator中,选择您的项目.
  2. 在中央屏幕上,转到 Build Settings
  3. 为"框架搜索路径"添加过滤器
  4. 输入$(inherited)值; 它应该自动填充评估该表达式的数据

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

Xcode预览