Wiingaard
Wiingaard

Reputation: 4302

Cocoapods is installing old Pod version

I'm using RxSwift and other Rx-pods in my app, according to my Podfile.lock I use RxSwift (3.2.0), but now I want to update the Pods to the latest versions.

So I remove the 4 Rx..-pods that I use from my Podfile, and run pod install, this removed the pods from the project and the Podfile.lock. The I re-add the 4 Rx..-pods and run pod instalagain. This installs RxSwift 2.6.1... Why? - I'm expecting it to install the newest stable version of RxSwift, something like 3.6.1..

I tried removing everything listed by: gem list --local | grep cocoapods and reinstalling cocoapods by running: gem install cocoapods

I also tried running pod repo update without success.

I also tried just running pod update, without uninstalling the Pods first, also same outcome.

I suspect this to be an issue with my cocoapods-gem, not The Rx-pods..

Edit added Podfile:

source 'https://github.com/CocoaPods/Specs.git'
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'MyApp' do
    pod 'BrightFutures'
    pod 'Alamofire'
    pod 'MBProgressHUD'
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'Analytics', '~> 3.0'
    pod 'SwiftyJSON'
    pod 'Eureka', '~> 2.0.0-beta.1'
    pod 'RxCocoa'
    pod 'RxSwift'
    pod 'INTULocationManager'
    pod 'ReachabilitySwift', '~> 3'
    pod 'RxSwiftExt'
    pod 'RxMKMapView'
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '3.0'
        end
    end
end

Edit Added pod outdateddump:

Analyzing dependencies
The following pod updates are available:
- Alamofire 4.3.0 -> 4.5.0 (latest version 4.5.0)
- Analytics 3.5.7 -> 3.6.4 (latest version 3.6.4)
- BrightFutures 5.1.0 -> 5.2.0 (latest version 6.0.0-beta.1)
- Crashlytics 3.8.3 -> 3.8.5 (latest version 3.8.5)
- Eureka 2.0.0-beta.1 -> 2.0.1 (latest version 3.1.0)
- Fabric 1.6.11 -> 1.6.12 (latest version 1.6.12)
- Result 3.1.0 -> 3.2.3 (latest version 3.2.3)
- RxCocoa 3.2.0 -> 3.6.1 (latest version 3.6.1)
- RxSwift 3.2.0 -> 3.6.1 (latest version 3.6.1)

Upvotes: 3

Views: 6545

Answers (2)

Wiingaard
Wiingaard

Reputation: 4302

The latest release of RxMKMapView needs RxCocoa 2.x.x. Apparently they need to update the Podspec, to allow RxCocoa 3.x.x. They did this in a commit, but it was never uploaded to cocoapods (or however that works). So I solved the problem by getting the pod from that commit. Because the pod RxCocoadidn’t have a minimum version requirement, cocoapods would just get latest version of RxCocoa that satisfied pod RxMKMapView, which was an old version (2.x.x). This was why I though something was wrong with my Cocoapod install, turns out it’s important to declare minimum versions of the wanted pods.. This solved the problem:

pod ‘RxCocoa’, ‘~> 3’
pod ‘RxSwift’, ‘~> 3’
pod ‘RxMKMapView’, :git => ‘https://github.com/RxSwiftCommunity/RxMKMapView.git', :commit => ‘6b86c6a’

Upvotes: 1

nathan
nathan

Reputation: 9395

You could try the following:

Clearing CocoaPods' cache:

  • rm -rf "${HOME}/Library/Caches/CocoaPods"
  • rm -rf "`pwd`/Pods/" (while in your project's dir)
  • Finally pod update

If you are using 0.38.0.beta1, you can just use pod cache clean


Regenerate everything:

  • rm -rf ~/Library/Caches/CocoaPods
  • rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*
  • pod deintegrate; pod setup; pod install

Set the version

pod 'RxSwift', '~> 3.0' # last version is 3.6.1

Upvotes: 8

Related Questions