My project is mostly written in Objective-C and I'm using Realm in it. I want to add Charts library with realm support but I get an error when trying to add it using cocoapods.
The Podfile looks like that (with some other libraries)
platform :ios, '9.0'
use_frameworks!
target 'MY_PROJECT' do
pod 'Realm'
pod 'Charts/Realm'
end
and the error I'm getting is this:
[!] Unable to satisfy the following requirements:
- `Realm` required by `Podfile`
- `Realm` required by `Podfile`
- `Realm` required by `Podfile`
- `Realm (= 2.0.0)` required by `Podfile.lock`
- `Realm (= 0.97.0)` required by `RealmSwift (0.97.0)`
Since my project is mixed, I can't use RealmSwift directly. Any Ideas?
A problem is not mixing Realm and RealmSwift. You seems install Realm without Charts first, then add Charts to the Podfile then pod install
, right? So the Podfile.lock
(a file pinning library to specific version) pinned Realm to 2.0.0
but Charts requires older version of RealmSwift (RealmSwift depends on Realm implicitely). That is the cause of the error.
To resolve that, you can execute pod update
or just delete pod 'Realm'
from the Podfile. Either way remove Realm 2.0 then install Realm and RealmSwift 1.1.0 (1.1.0 is Chart's required).
You cannot use higher version of Realm because Charts requres 1.1.0.