cocoapods错误集锦

1、pod install时出现如下图所示错误

> - Use the `$(inherited)` flag, or
> 
> - Remove the build settings from the target.
image

按照上图红线标注信息进行查找修改,以我的错误信息为例:

如下图,在MyStudySwiftTests的build setting中查找ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES,选择other添加$(inherited),编译,重新pod install解决错误

image

2、mac系统更新导致cocoapods失效

image

解决办法:

$ sudo gem update --system
$ sudo gem install cocoapods -n/usr/local/bin

3、cocoapods搜索不到最新的三方库

image

4、cocoapods安装时提示吐下信息

Automatically assigning platform ios with version 9.0 on target XiaoFeiShang_Swift because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.
解决办法:去掉Podfile中platform前的#符号

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'XiaoFeiShang_Swift' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for XiaoFeiShang_Swift

end

5、cocoapods搜索不到三方库最新版本

pod cache clean --all
rm -rf ~/Library/Caches/CocoaPods
pod repo update

6、执行pod install时报错

错误信息

错误原因:如上图所示,需要安装的三方库为Alamofire,版本为5.0.0-beta.2,该版本最低支持的iOS target为10.0,但我的podfile文件中platform版本是低于10.0的,所以报错
修改方法:如下图所示,将platform后版本修改为10.0即可


修改信息

7、错误信息如下:

cocoapods Pods/Pods/Target Support Files/Pods-xxx/Pods-xxx.debug.xcconfig: unable to open file (in target "xxx" in project "xxx") (in target 'xxx')
解决办法一:

sudo gem install cocoapods --pre   

如果执行失败,提示You don't have write permissions for the /usr/bin directory,使用方法二:

sudo gem install cocoapods -n/usr/local/bin --pre
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容