2014-10-18 63 views
45

我想问一下,然后回答这个问题。目标覆盖FRAMEWORK_SEARCH_PATHS构建设置

我想更新内置到我的应用程序中的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. 

你怎么使用$(继承)标志?

回答

86

选择项目,targets->应用程序,然后Build Settings,我增加了$(继承)线,删除任何特定荚之前已经提及有:

enter image description here

我希望这可以帮助别人。

+1

Thx。我必须删除指定的pod,并且必须用您提到的$(继承)来替换它。 – palme 2015-01-21 16:39:55

+1

在我的情况下,我需要添加$(PROJECT_DIR) – kakashy 2016-02-22 16:58:03

+0

这个答案是一个漫长而漫长的搜索的结束。感谢您发表回复和评论。 – AndrewHenderson 2017-03-18 03:59:15

10

我也遇到过这个问题。

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

如果目录中只有一个.xcodeproj文件,通常情况下,pod install将自动工作。但是,如果您正在将您的项目从旧的手动添加框架/第三方项目的方式迁移到您的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' 

您Podfile选择正确.xcodeproj后,转到Xcode和执行以下操作:

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

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

Xcode preview

+1

只需要注意一下:CocoaPods 1.3.1给出了一个弃用警告:“''xcodeproj'已被重命名为'project',请相应地更新您的Podfile。 – AmitaiB 2017-09-24 18:08:04