我刚刚更新到 Xcode 10.1
Swift 版本 4.2.1
我有几个构建错误:
Invalid redeclaration of '<~'
我关注了this GitHub q&A和 this one这表示我需要将 ObjectMapper
pod 更新到版本 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'
在终端我不断得到:
为什么我总是收到此错误?
这是常规的 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
最佳答案
我不得不从我的项目中删除所有 pod,然后重新安装它们。
首先运行下面的代码,因为你必须安装 cocoapods-clean 插件才能运行 pod clean。
$ sudo gem install cocoapods-clean
其次,我从我的 podfile 中复制了所有的 pod,并将它们放在一个不同的临时文件中,然后我运行了以下 3 个命令来删除所有的 pod:
$ pod deintegrate
$ pod clean
$ rm Podfile
在使用上述 3 个命令清理干净之后,我运行 pod init
来创建一个新的 Podfile
,打开它,并从临时文件中粘贴保存的 pod。我还将以下 ObjectMapper
pod 添加到 Podfile:
$ pod 'ObjectMapper'
然后我运行 pod install
来安装所有东西
一切都完成后,我运行 $ vim Podfile.lock
并且 ObjectMapper
现在有一个版本:
- ObjectMapper (3.4.1)
关于xcode - Cocapods - 无法将 pod ObjectMapper 更新到版本 3.3 错误 [!] 未知命令 : `ObjectMapper,` ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53371157/