繁体   English   中英

Cocoapods正在安装旧的Pod版本

[英]Cocoapods is installing old Pod version

我在我的应用程序中使用RxSwift和其他Rx-pods,根据我的Podfile.lock我使用RxSwift (3.2.0) ,但现在我想将RxSwift (3.2.0)更新到最新版本。

所以我从我的Podfile删除了我使用的4个Rx ..- pod install ,并运行pod install ,这从项目和Podfile.lock删除了Podfile.lock 我重新添加4个Rx ..- pod并再次运行pod instal 这安装了RxSwift 2.6.1 ...... 为什么? - 我希望它能安装最新的稳定版RxSwift ,比如3.6.1 ..

我尝试删除列出的所有内容: gem list --local | grep cocoapods gem list --local | grep cocoapods并通过运行: gem install cocoapods重新gem install cocoapods

我也试过运行pod repo update但没有成功。

我也尝试过只运行pod update ,而不首先卸载pod update ,也是同样的结果。

我怀疑这是我的cocoapods -gem的一个问题,而不是The Rx-pods ..

编辑添加的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

编辑添加的pod outdated转储:

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)

您可以尝试以下方法:

清除CocoaPods的缓存:

  • rm -rf“$ {HOME} / Library / Caches / CocoaPods”
  • rm -rf“`pwd` / Pods /”(在项目的目录中)
  • 最后pod update

如果您使用的是0.38.0.beta1,则可以使用pod cache clean


重生一切:

  • rm -rf~ / Library / Caches / CocoaPods
  • rm -rf Pods; rm -rf~ / Library / Developer / Xcode / DerivedData / *
  • pod deintegrate; pod设置; pod安装

设置版本

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

最新版本的RxMKMapView需要RxCocoa 2.xx显然他们需要更新Podspec,以允许RxCocoa 3.xx他们在提交中这样做,但它从未上传到cocoapods(或者无论如何有效)。 所以我通过从提交中获取pod来解决问题。 因为pod RxCocoa没有最低版本要求,cocoapods只会获得满足pod RxMKMapView最新版本的pod RxMKMapView ,这是旧版本(2.xx)。 这就是为什么我的Cocoapod安装出了问题,原来声明所需pod的最小版本很重要..这解决了这个问题:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM