iOS SDK

cocoapods错误集锦

2018-06-30  本文已影响98人  sky_fighting

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即可


修改信息
上一篇 下一篇

猜你喜欢

热点阅读