
公司項目在執(zhí)行
pod install的時候總是出現(xiàn)很多黃色的警告,因為是警告并不會影響項目的正常編譯,一直沒有在意,但是總是有很多警告看起來很不舒服,于是就花了點時間解決掉了,下面將解決方法記錄下來分享給有同樣問題的你們。
警告信息
產(chǎn)生此警告的原因是項目 Target 中的一些設置,CocoaPods 也做了默認的設置,如果兩個設置結(jié)果不一致,就會造成問題,顯示的警告信息如下:
[!] The `client_ios_fm_a [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-client_ios_fm_a/Pods-client_ios_fm_a.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `client_ios_fm_a [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-client_ios_fm_a/Pods-client_ios_fm_a.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `client_ios_fm_a [Debug]` target overrides the `OTHER_CFLAGS` build setting defined in `Pods/Target Support Files/Pods-client_ios_fm_a/Pods-client_ios_fm_a.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `client_ios_fm_a [Debug]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-client_ios_fm_a/Pods-client_ios_fm_a.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `client_ios_fm_a [Release]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-client_ios_fm_a/Pods-client_ios_fm_a.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `client_ios_fm_a [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-client_ios_fm_a/Pods-client_ios_fm_a.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `client_ios_fm_a [Release]` target overrides the `OTHER_CFLAGS` build setting defined in `Pods/Target Support Files/Pods-client_ios_fm_a/Pods-client_ios_fm_a.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `client_ios_fm_a [Release]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-client_ios_fm_a/Pods-client_ios_fm_a.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

解決方法
打開項目
Target-Build Settings,搜索Other Linker Flags,在這個設置上加入$(inherited)。打開項目
Target-Build Settings,依次搜索如下圖所示的警告上提示的設置名稱,將這些設置選項全部改為$(inherited),或者選中這些設置按下delete鍵恢復原設置。

如果有
FRAMEWORK_SEARCH_PATHS這個設置的警告的話,最好先把當前的設置項記錄下來,然后選中設置按下delete以后,再把之前的設置加進去,否則編譯可能會出現(xiàn)很多報錯。然后重新執(zhí)行
pod install或者pod update就會發(fā)現(xiàn)警告消失了。如果我的方法不能夠解決你的問題的話,可以試一下網(wǎng)上的另一種方法,就是點擊項目文件
project.xcodeproj,右鍵顯示包內(nèi)容,用文本編輯器打開project.pbxproj,command + F搜索OTHER_LDFLAGS,刪除搜索到的設置,command + S保存,然后重新執(zhí)行pod install或者pod update。
方法就是這樣,希望我的方法能夠解決你的問題。
將來的你,一定會感激現(xiàn)在拼命的自己,愿自己與讀者的開發(fā)之路無限美好。