我的CocoaPods工作正常,直到我尝试安装一个新的。 如果我尝试安装新的pod,那么在图表pod中有几个问题,否则它可以正常工作。 我如何解决它?
错误显示如下:
我的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
注意:确保项目的swift语言版本。以下是您查看/检查快速语言版本的方法。
您有两个选项作为查询的解决方案:
根据您在问题中添加的快照 - 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
去构建目标'Tranquil'的设置然后到'Swift Language Version'部分并将其设置为'Swift 4.0'。接下来,使用命令“pod install”重新安装pod。接下来,重建您的项目。