2

My CocoaPods works fine until I try to install a new one.
If I try to install a new pod, then there are several issues in charts pod, else it works fine.
How do I fix it?

The errors show up as below:

Issues in charts

My podfile is as below:

# 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
Gonen
  • 4,005
  • 1
  • 31
  • 39
  • 1
    `NSAttributedStringKey` that smells Swift 4. While you seem to be using Swift 3 only. So as you did for Alamofire adding `'~> 4.0'`, add the version that is Swift 3 compliant. According to this: https://github.com/danielgindi/Charts/releases should be the version tagged `3.0.3`. – Larme Nov 16 '17 at 09:22

2 Answers2

0

Go to build settings of the target 'Tranquil' then to the section 'Swift Language Version' and set it to 'Swift 4.0'. Next, reinstall your pods with a command 'pod install'. Next, rebuild your project.

Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93
0

Note: Ensure swift language version of your project. Here is how you can see/check your swift language version.

enter image description here


You have two options as solution to your query:

  1. If your project has Swift versio 4.0
    - You should choose/download POD compatible to your project's swift language (Share me POD info and swift version, so I can provide you exact pod version version for your pod library suitable for project).

  2. If your project has swift version below 4.0
    - You need to migrate your project into Swift 4.0 (if you've not migrated it). Here is ref question and answer, how to migrate from swift (below) <4.0 to 4.0.


According to snapshot added by you in your question - Swift 3.x is your current project language version and pod 'Charts' is supporting swift 4.

pod 'Charts'

Here is list of previous release supporting Swift version below 4.0.

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

Try previous release of cosmos like:

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

'

Similar way you can find previous release of Alamofire (supporting Swift below 4.0) from here - Alamofire - Releases

Try this with Swift 3.2 and see:

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
Krunal
  • 77,632
  • 48
  • 245
  • 261
  • Still its the same. – Geethanjali Reddy Nov 16 '17 at 10:47
  • Thank you.I just tried this and it works! `# 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', '~> 1.7' pod 'Alamofire', '~> 4.0' pod 'Charts', '3.0.3' pod 'SwiftyJSON', '3.0.0' end ` – Geethanjali Reddy Nov 20 '17 at 09:42