3
votes

I have the following cocoapods Podfile

platform :ios, '8.0'

use_frameworks!

target 'Foo' do
        pod "SwiftyJSON", '~> 2.2.0'
        pod "Locksmith"
        pod "GoogleMaps"
        pod "RealmSwift"
end

target 'FooTests' do

end

I'm also using cocoapods 0.37.2. For some reason, when I try to run the app, it complains with the following error, when clearly I have specified that my project requires SwiftyJSON 2.2.0 or greater:

 Reason: Incompatible library version: Foo requires version 2.0.0 or later, but SwiftyJSON provides version 1.0.0

I have verified that there's no other dependencies on SwiftyJSON (using cocoapods-dependencies):

$pod dependencies

Dependencies
---
- GoogleMaps (1.10.1)
- Locksmith (1.2.2)
- Realm (0.93.2):
  - Realm/Headers (= 0.93.2)
- Realm/Headers (0.93.2)
- RealmSwift (0.93.2):
  - Realm (= 0.93.2)
- SwiftyJSON (2.2.0)

As you can see, no one is pulling SwiftyJSON 1.0.0. By the way, the reason I'm using cocoapods 0.37.2 is because of this bug when I tried to use 0.38.1: https://github.com/CocoaPods/CocoaPods/issues/3890.

Have I missed anything here (regarding the SwiftyJSON version mismatch) ? I've tried cleaning the project, redoing pod install, etc without any luck..

Thanks in advance!

1
Well. This sounds crazy, but I just removed SwiftyJSON as a dep, upgraded cocoapods to 0.38.0, added SwiftyJSON again, and do pod install. Then re open my project. Everything looks good. I dont know whether it was because of the upgrade, or whether it is because of remove-and-add-again that fixed my problem. I've wasted about 3 hours today trying to fix this silly problem.caffeine_inquisitor
I'm having same issue, started today as well (post cocoapods 0.38.1 installation, and I've since downgraded to 0.37.2 and it's still happening)Steve N

1 Answers

1
votes

For me (and for you it seems), the following worked:

  1. Remove guilty pods from podfile (in my case, AFNetworking and AFNetworkActivityLogger)
  2. pod install to wipe them out
  3. Upgrade (or downgrade if you're on 0.38.1) to cocoapods 0.38.0
  4. Add pods back & pod install

Now I'm back in business... I believe 0.38.1 was responsible for getting me into this mess.