xcode CocoaPods 错误 pod install HEADER_SEARCH_PATHS

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

CocoaPods Error pod install HEADER_SEARCH_PATHS

iosxcodexcode6cocoapods

提问by AndroidDev

First foray into CocoaPods (and I'm not very happy with it!). I followed all of the instructions. When I do pod installthis is what i get:

第一次尝试 CocoaPods(我对它不是很满意!)。我遵循了所有说明。当我这样做时pod install,我得到的是:

Analyzing dependencies
Downloading dependencies
Using AFNetworking (2.4.1)
Using Braintree (3.4.0)
Generating Pods project Integrating client project

[!] The MyProject [Debug]target overrides the HEADER_SEARCH_PATHSbuild setting defined in Pods/Target Support Files/Pods-MyProject/Pods-MyProject.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the$(inherited)` flag, or
- Remove the build settings from the target.

[!] The MyProject [Debug]target overrides the OTHER_LDFLAGSbuild setting defined in Pods/Target Support Files/Pods-MyProject/Pods-MyProject.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the$(inherited)` flag, or
- Remove the build settings from the target.

[!] The MyProject [Release]target overrides the HEADER_SEARCH_PATHSbuild setting defined in Pods/Target Support Files/Pods-MyProject/Pods-MyProject.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the$(inherited)` flag, or
- Remove the build settings from the target.

[!] The MyProject [Release]target overrides the OTHER_LDFLAGSbuild setting defined in Pods/Target Support Files/Pods-MyProject/Pods-MyProject.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the$(inherited)` flag, or
- Remove the build settings from the target.

分析依赖
下载依赖
使用 AFNetworking (2.4.1)
使用 Braintree (3.4.0)
生成 Pods 项目 集成客户端项目

[!]MyProject [Debug]目标覆盖$(inherited)` 标志中HEADER_SEARCH_PATHS定义的 构建设置Pods/Target Support Files/Pods-MyProject/Pods-MyProject.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the,或者
- 从目标中删除构建设置。

[!]MyProject [Debug]目标覆盖$(inherited)` 标志中OTHER_LDFLAGS定义的构建设置Pods/Target Support Files/Pods-MyProject/Pods-MyProject.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the,或者
- 从目标中删除构建设置。

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

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

Here is my Podfile:

这是我的 Podfile:

source 'https://github.com/CocoaPods/Specs.git'

target 'ActivFocus' do
pod 'Braintree' # Alternatively: pod 'Braintree', '~> 3.0.0'
pod "AFNetworking", "~> 2.0"
end

target 'ActivFocusTests' do
pod 'Braintree' # Alternatively: pod 'Braintree', '~> 3.0.0'
pod "AFNetworking", "~> 2.0"
end

源' https://github.com/CocoaPods/Specs.git'

target 'ActivFocus' do
pod 'Braintree' # 或者:pod 'Braintree', '~> 3.0.0'
pod "AFNetworking", "~> 2.0"
end

target 'ActivFocusTests' do
pod 'Braintree' # 或者:pod 'Braintree' ', '~> 3.0.0'
pod "AFNetworking", "~> 2.0"
结束

I don't know how to follow the suggestion:

我不知道如何遵循建议:

- Use the '$(inherited)' flag, or
- Remove the build settings from the target.
- Use the '$(inherited)' flag, or
- Remove the build settings from the target.

EDIT: This is the Xcode error that I get when trying to build the project as a result of this:

编辑:这是我在尝试构建项目时遇到的 Xcode 错误:

Ld /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator/MyProject.app/MyProject normal i386 cd /Users/randy/Development/MyProject/iOSApp/MyProject export IPHONEOS_DEPLOYMENT_TARGET=7.1 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator -L/Users/randy/Development/MyProject/iOSApp/MyProject/Pods/Braintree/Braintree/PayPal/mSDK -L/Users/randy/Development/MyProject/iOSApp/MyProject -L/Users/randy/Development/MyProject/iOSApp/MyProject/MyProject/libs/ios_libs/simplify/vendor/ocmock -F/Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator -F/Users/randy/Development/MyProject/iOSApp/MyProject/MyProject/libs/ios_libs/simplify -F/Users/randy/Development/MyProject/iOSApp/MyProject/MyProject -F/Users/randy/Development/MyProject/iOSApp/MyProject -filelist /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/i386/MyProject.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework AVFoundation -framework CoreData -framework QuartzCore -framework MediaPlayer -framework CoreGraphics -framework UIKit -framework Foundation -lPods-MyProject -Xlinker -dependency_info -Xlinker /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator/MyProject.app/MyProject

ld: library not found for -lPods-ActivFocus clang: error: linker
command failed with exit code 1 (use -v to see invocation)

Ld /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator/MyProject.app/MyProject normal i386 cd /Users/randy/Development/MyProject/iOSApp/MyProject export IPHONEOS_DARGETLOY7导出路径="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin: /usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator。平台/开发人员/SDKs/iPhoneSimulator8.1。sdk -L/Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator -L/Users/randy/Development/MyProject/iOSApp/MyProject/Pods/Braintree/Braintree/PayPal/ mSDK -L/Users/randy/Development/MyProject/iOSApp/MyProject -L/Users/randy/Development/MyProject/iOSApp/MyProject/MyProject/libs/ios_libs/simplify/vendor/ocmock -F/Users/randy/Library/开发人员/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator -F/Users/randy/Development/MyProject/iOSApp/MyProject/MyProject/libs/ios_libs/simplify -F/Users/randy/Development/MyProject/ iOSApp/MyProject/MyProject -F/Users/randy/Development/MyProject/iOSApp/MyProject -filelist /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Intermediates/MyProject。build/Debug-iphonesimulator/MyProject.build/Objects-normal/i386/MyProject.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min =7.1 -framework AVFoundation -framework CoreData -framework QuartzCore -framework MediaPlayer -framework CoreGraphics -framework UIKit -framework Foundation -lPods-MyProject -Xlinker -dependency_info -Xlinker /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvyrdbksivza Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug- iphonesimulator/MyProject.app/MyProjectbuild/Objects-normal/i386/MyProject.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework AVFoundation -framework CoreData -framework QuartzCore -framework MediaPlayer -framework CoreGraphics -framework UIKit -framework Foundation -lPods-MyProject -Xlinker -dependency_info -Xlinker /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Intermediates/MyProject Debug-iphonesimulator/MyProject.build/Objects-normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator/MyProject.app/MyProjectbuild/Objects-normal/i386/MyProject.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework AVFoundation -framework CoreData -framework QuartzCore -framework MediaPlayer -framework CoreGraphics -framework UIKit -framework Foundation -lPods-MyProject -Xlinker -dependency_info -Xlinker /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Intermediates/MyProject Debug-iphonesimulator/MyProject.build/Objects-normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator/MyProject.app/MyProjectLinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework AVFoundation -framework CoreData -framework QuartzCore -framework CoreGraphics-framework框架 UIKit -framework Foundation -lPods-MyProject -Xlinker -dependency_info -Xlinker /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects- normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator/MyProject.app/MyProjectLinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework AVFoundation -framework CoreData -framework QuartzCore -framework CoreGraphics-framework框架 UIKit -framework Foundation -lPods-MyProject -Xlinker -dependency_info -Xlinker /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects- normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator/MyProject.app/MyProject1 -framework AVFoundation -framework CoreData -framework QuartzCore -framework MediaPlayer -framework CoreGraphics -framework UIKit -framework Foundation -lPods-MyProject -Xlinker -dependency_info -Xlinker /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvyrdwesozcamslpe /Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator /MyProject.app/MyProject1 -framework AVFoundation -framework CoreData -framework QuartzCore -framework MediaPlayer -framework CoreGraphics -framework UIKit -framework Foundation -lPods-MyProject -Xlinker -dependency_info -Xlinker /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvyrdwesozcamslpe /Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/Objects-normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator /MyProject.app/MyProjectbuild/Objects-normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator/MyProject.app/MyProjectbuild/Objects-normal/i386/MyProject_dependency_info.dat -o /Users/randy/Library/Developer/Xcode/DerivedData/MyProject-epuhpnvywesozcamslrdbksivzae/Build/Products/Debug-iphonesimulator/MyProject.app/MyProject

ld:找不到 -lPods-ActivFocus clang 的库:错误:链接器
命令失败,退出代码为 1(使用 -v 查看调用)

回答by Naveen Prasad R

If there is no manual overriding done for header search path, try deleting the pod config files which is added to your project. This can be found at YourProject\Pods(and not in pods project, check the image). Try running pod install once again and check.

如果没有对标头搜索路径进行手动覆盖,请尝试删除添加到项目中的 pod 配置文件。这可以在YourProject\Pods(而不是在 pods 项目中,检查图像)中找到。再次尝试运行 pod install 并检查。

Pod Config File

Pod 配置文件

If you have manually added header path, then ignore the warning and add an inherited flag in the search path as below

如果您手动添加了标题路径,则忽略警告并在搜索路径中添加一个继承标志,如下所示

Inherited Flag to the header search path

将标志继承到标头搜索路径