CocoaPods 錯誤 target overrides the `OTHER_LDFLAGS`...
Xcode 升級到 6.0 后,更新 CocoaPods,出現了如下的警告
[!] The `Paopao [Debug]` target overrides the `PODS_ROOT` 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 `Paopao [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 `Paopao [Release]` target overrides the `PODS_ROOT` 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 `Paopao [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.
這種警告是不能忽視的,它帶來的直接后果就是無法通過編譯。
而產生此警告的原因是項目 Target 中的一些設置,CocoaPods 也做了默認的設置,如果兩個設置結果不一致,就會造成問題。
我想要使用 CocoaPods 中的設置,分別在我的項目中定義`PODS_ROOT` 和 `Other Linker Flags`的地方,把他們的值用`$(inherited)`替換掉,進入終端,執行
pod update
警告沒了,回到 Xcode,build通過。
網上還流行另外一種簡單粗暴的方法
點擊項目文件 project.xcodeproj,右鍵`顯示包內容`,用文本編輯器打開`project.pbxproj`,刪除`OTHER_LDFLAGS`的地方,保存,回到 Xcode,編譯通過。
參考資料