1 pod search xxxx 出現
Unable To find a pod with name , author ....
先執(zhí)行
pod setup
再次搜索, 如果仍然報錯則執(zhí)行
rm ~/Library/Caches/CocoaPods/search_index.json
2 pod install 出現
/Library/Ruby/Site/2.0.0/rubygems.rb:271:in find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException) from /Library/Ruby/Site/2.0.0/rubygems.rb:299:inactivate_bin_path'
from /usr/local/bin/pod:22:in `<main>'
sudo gem uninstall cocoapods
sudo gem install -n /usr/local/bin cocoapods --pre
pod install
3 pod install 出現
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory
sudo gem update --system
sudo gem install -n /usr/local/bin cocoapods
4 使用cocoapod加入第三方庫昂拂,打開項目有時會出現編譯錯誤拒啰,錯誤如下:
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_AFHTTPRequestOperationManager", referenced from:
objc-class-ref in AFNetworkingUtil.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
- 檢查 Build Setting -> Architectures 配置是否正確
890AD2A6-7DF3-479A-A5EE-9B9D312AD723.png
- 在 target -> Build Settings -> Other Linker Flags 添加字段
$(inherited)