CocoaPods使用问题解决

2018-01-22  本文已影响70人  关键我也没
1 pod search xxxx 出现

Unable To find a pod with name , author ....

先执行

pod setup

再次搜索, 如果仍然报错则执行

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)

  1. 检查 Build Setting -> Architectures 配置是否正确
890AD2A6-7DF3-479A-A5EE-9B9D312AD723.png
  1. 在 target -> Build Settings -> Other Linker Flags 添加字段
$(inherited)
上一篇 下一篇

猜你喜欢

热点阅读