Cocapods - 无法将 pod ObjectMapper 更新到 3.3 版错误 [!] 未知命令:`ObjectMapper,`

Lan*_*ria 3 xcode cocoapods podfile

我刚刚更新到Xcode 10.1Swift 版本4.2.1,我有几个构建错误:

'<~' 的重新声明无效

我跟着这个 GitHub q&A这个说我需要将ObjectMapperpod更新到版本的3.3

我没有在常规Podfile中看到ObjectMapper但是我在里面看到了它,Podfile.Lock并且版本是- ObjectMapper (2.2.9)

在此处输入图片说明

然后我去了终端并尝试了所有这些更新,3.3但没有一个工作:

$ pod repo update
$ pod update
$ pod update ObjectMapper
$ pod 'ObjectMapper', '~> 3.3'
$ pod 'ObjectMapper', '3.3'
Run Code Online (Sandbox Code Playgroud)

在终端我不断得到:

在此处输入图片说明

为什么我一直收到这个错误?

这是常规的 podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

target 'MyProject' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MyProject

pod 'Stripe'
pod 'AFNetworking'
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'SDWebImage'
pod 'Fabric'
pod 'Crashlytics'
pod 'KeychainSwift'
pod 'IQKeyboardManagerSwift'
pod 'DLRadioButton', '~> 1.4'

pod 'GoogleInterchangeUtilities'
pod 'GoogleNetworkingUtilities'
pod 'GoogleParsingUtilities'
pod 'GoogleSymbolUtilities'
pod 'GoogleUtilities'

pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Storage'
pod 'Firebase/Crash'
pod 'Firebase/Messaging'
pod 'FirebaseInstanceID', '3.2.0'

pod 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'

pod 'GooglePlacesAPI'
pod ‘GoogleMaps’
pod 'GooglePlaces'
pod 'GooglePlacePicker'

pod 'ReachabilitySwift'

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

end
Run Code Online (Sandbox Code Playgroud)

Lan*_*ria 5

我不得不从我的项目中删除所有 pod,然后重新安装它们。

首先运行以下代码,因为您必须安装 cocoapods-clean 插件才能运行 pod clean。

$ sudo gem install cocoapods-clean

其次,我从 podfile 中复制了所有 pod,并将它们放在一个临时的不同文件中,然后运行以下 3 个命令来删除所有 pod:

$ pod deintegrate
$ pod clean
$ rm Podfile
Run Code Online (Sandbox Code Playgroud)

使用上述 3 个命令将其清理干净后,我运行pod init创建一个新的Podfile. 我还将以下ObjectMapperpod添加到 Podfile 中:

$ pod 'ObjectMapper'
Run Code Online (Sandbox Code Playgroud)

然后我跑去pod install安装一切

一切都完成后,我跑$ vim Podfile.lock了,ObjectMapper现在有一个版本:

- ObjectMapper (3.4.1)
Run Code Online (Sandbox Code Playgroud)