添加新pod时CocoaPods出现问题

问题描述 投票:2回答:2

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

错误显示如下:

Issues in charts

我的podfile如下:

# 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
ios swift cocoapods swift4 ios-charts
2个回答
0
投票

注意:确保项目的swift语言版本。以下是您查看/检查快速语言版本的方法。

您有两个选项作为查询的解决方案:

  1. 如果你的项目有Swift versio 4.0 - 您应该选择/下载与您项目的快速语言兼容的POD(分享我的POD信息和swift版本,这样我就可以为您的pod库提供适合项目的精确pod版本)。
  2. 如果您的项目的swift版本低于4.0 - 您需要将项目迁移到Swift 4.0(如果您没有迁移它)。这是ref问题和答案,如何从swift(下面)<4.0迁移到4.0。 Xcode 9 Swift Language Version (SWIFT_VERSION)

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

pod 'Charts'

以下是支持低于4.0的Swift版本的早期版本列表。

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

尝试以前发布的宇宙,如:

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

'

类似的方式你可以从这里找到以前发布的Alamofire(支持低于4.0的Swift) - 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

0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.