添加新pod时CocoaPods出现问题

时间:2017-11-16 09:19:41

标签: ios swift cocoapods swift4 ios-charts

我的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

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

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

enter image description here


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

  1. 如果您的项目有Swift versio 4.0 - 您应该选择/下载与您项目的快速语言兼容的POD(分享我的POD信息和swift版本,所以我可以为您的pod库提供适合项目的精确pod版本。

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


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

    pod 'Charts'
    

    以下是支持低于4.0的Swift版本的上一版本列表。

    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(支持低于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