CocoaPods 在添加新 pod 时出现问题

CocoaPods issues while adding a new pod

我的 CocoaPods 工作正常,直到我尝试安装一个新的。
如果我尝试安装一个新的 pod,那么图表 pod 中有几个问题,否则它工作正常。
我如何解决它?

错误显示如下:

我的播客文件如下:

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

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

# Pods for TranquillocationText
pod 'GooglePlaces'
pod 'UICircularProgressRing'
pod 'Alamofire', '~> 4.0' . //if i try to add this pod then error occurs
pod 'Charts'
end

转到目标 'Tranquil' 的构建设置,然后转到 'Swift Language Version' 部分并将其设置为 'Swift 4.0'。接下来,使用命令 'pod install' 重新安装 pods。接下来,重建您的项目。

注意:确保项目的 swift 语言版本。这是 see/check 您的 swift 语言版本的方法。


您有两种选择来解决您的问题:

  1. 如果您的项目有 Swift versio 4.0
    - 您应该 choose/download POD 兼容您项目的 swift 语言(与我分享 POD 信息和 swift 版本,这样我就可以为您提供适用于项目的 pod 库的确切 pod 版本)。

  2. 如果您的项目 swift 版本低于 4.0
    - 您需要将项目迁移到 Swift 4.0(如果您尚未迁移它)。这是参考问题和答案,如何从 swift(以下)<4.0 迁移到 4.0.


根据您在问题中添加的快照 - Swift 3.x 是您当前的项目语言版本,pod 'Charts' 支持 swift 4.

pod 'Charts'

这是支持 Swift 4.0 以下版本的先前版本列表。

https://github.com/danielgindi/Charts/releases

像这样尝试以前版本的 cosmos:

pod 'Charts', '~> 3.0.3'
// or
pod 'Charts', '~> 3.0.2'
// or
pod 'Charts', '~> 3.0.1'

'

您可以从此处找到以前版本的 Alamofire(支持 Swift 低于 4.0)的类似方法 - Alamofire - Releases

Swift 3.2 试试看:

platform :ios, '9.0'
use_frameworks!

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

# Pods for TranquillocationText
pod 'GooglePlaces'
pod 'UICircularProgressRing', '~> 1.7'
pod 'Alamofire', '~> 4.0'
pod 'Charts', '3.0.3'
pod 'SwiftyJSON', '3.0.0'

end