CocoaPod出现“target overrides the `OTHER_LDFLAGS`……的解决方案

今天在项目中引入AFNetworking。
Podfile的内容

platform :ios, '7.0'
pod "AFNetworking", "~> 2.0"

出现了一个错误

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

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

[!] The `AllBlue [Release]` target overrides the `OTHER_LDFLAGS` build 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.

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

大衣就是target的设置覆盖了 pod的设置。
这个警告会导致再代码编译的时候出现错误
library not found for -lPods
解决方法:
在Build Settings -> Other linker flags 中添加$(inherited)

添加完成之后运行

pod update

Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Using AFNetworking (2.6.3)

警告消失!!!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容