3

I just updated to Xcode 10.1 Swift version 4.2.1 and I have several build errors of:

Invalid redeclaration of '<~'

I followed this GitHub q&A and this one that says I need to update the ObjectMapper pod to version 3.3

I didn't see the ObjectMapper inside the regular Podfile however I saw it inside the Podfile.Lock and the version is - ObjectMapper (2.2.9)

enter image description here

I then went to terminal and tried all of these to update to 3.3 but none of them worked:

$ pod repo update
$ pod update
$ pod update ObjectMapper
$ pod 'ObjectMapper', '~> 3.3'
$ pod 'ObjectMapper', '3.3'

In terminal I keep getting:

enter image description here

Why do I keep getting this error?

Here is the regular 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
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
  • Probably because you didn't do a `pod install` first (your last 2 commands btw are invalid), but... the reason you're seeing the library in the lockfile and not in your podfile, is because is a dependency of another library; which means that if you _do_ force a specific version in your podfile, and the library that installed it in the first place specifies a lower version (which is probably the case) you'll get nowhere. Best thing you can do is find out if there is an updated version of _that_ pod (the one who depends on `ObjectMapper`). I hope that this makes sense... – Alladinian Nov 19 '18 at 16:45
  • @Alladinian I actually did do pod install, I forgot to include it but it made no difference. You was correct about a different dependency including it, I had to update 3 different apps with basically all the same pods and after trial and error I realized that was the issue. It was just easier to wipe everything clean then add the ObjectMapper as it’s own pod. Oddly though the updated version of the pod the had it didn’t have the update ObjectMapper along with the update. Strange. Thanks for the advice! Enjoy your day – Lance Samaria Nov 19 '18 at 22:33

1 Answers1

5

I had to remove all the pods from my project then reinstall them.

First run the below code because you have to install the cocoapods-clean plugin to run pod clean.

$ sudo gem install cocoapods-clean

Second I copied all the pods from my podfile and placed them in a temporary different file then I ran the below 3 commands to remove all the pods:

$ pod deintegrate
$ pod clean
$ rm Podfile

After it was clean using the above 3 commands I then ran pod init to create a new Podfile, opened it, and pasted the saved pods from the temporary file. I also added the below ObjectMapper pod to the Podfile:

$ pod 'ObjectMapper'

Then I ran pod install to install everything

After everything was done I ran $ vim Podfile.lock and the ObjectMapper now had a version of:

- ObjectMapper (3.4.1)
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256