1.如果输入命令sudo gem install cocoapods报以下错误:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod
解决方案:输入命令:sudo gem install -n /usr/local/bin cocoapods --pre
2.如果报错Analyzing dependencies
[!] The dependency `R.swift (~> 1.3.0)` is not used in any concrete target.
解决方案:在pod 文件上下分别加上target '工程的名称' do跟end,如下图
3.如果报错:[!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pod being used is: R.swift.Library
解决方案:加上use_frameworks!如图