Thursday, March 24, 2016

cocoa pods Dependency management

Leave a Comment

[!] Unable to satisfy the following requirements:

  • SDWebImage (= 3.7) required by DZNPhotoPickerController/Core (1.6.0)
  • AFNetworking (~> 3.0) required by Podfile
  • AFNetworking (~> 1.3.3) required by DZNPhotoPickerController (1.0.2)

PodFile

pod 'DZNPhotoPickerController' pod 'ZXingObjC', '~> 3.0' pod 'vfrReader','~>2.8.6' pod 'Mantle' pod 'PPSSignatureView' pod 'AFNetworking','~>3.0' pod 'JNKeychain' pod 'SVProgressHUD' pod 'ZipArchive' 

I want to update AFNetworking.

Help me to solve this

3 Answers

Answers 1

To fix this you might need to

Fork the DZNPhotoPickerController repo and modify the dependency in the Pod spec and then use your forked repo's git location in the pod file. Not a great solution for the long term but works.

For instance, The Pod spec here should have the line#33 which is

ss.dependency 'AFNetworking' 

should be changed to

ss.dependency 'AFNetworking', '~> 3.0'  

in your forked repo.

Then use in your Pod file as below

pod 'DZNPhotoPickerController', :git => 'https://github.com/yourUsername/DZNPhotoPickerController.git' 

Your forked repo is not guaranteed to work out of the box if the project relies on legacy dependency code, if any. In this particular case, if it uses any methods of AFNetworking that is removed in 3.0 it will not work.

Answers 2

To update a single AFNetworking pod,

pod update AFNetworking 

with above code, cocoapods will find a latest updated pod version and update your pod.

To update your all pods you can use

pod update 

this will update your all the pods.

Answers 3

The issue looks like 'DZNPhotoPickerController' has dependancy of ss.dependency 'AFNetworking', '~> 2.6.0' so when you are trying to update AFNetworking to version 3.0 it shows the wrong version error.

If you didn't check it recently the 'DZNPhotoPickerController' has also updated it's podspec to make AFNetworking to 3.0 so you should try pod update now it may fix your issue as both dependancy needs the same version

If the above and the fork 'DZNPhotoPickerController' in to newer one didn't work

  • Please remove the 'DZNPhotoPickerController' from the cocoapods
  • update the cocoapods by pod update
  • if it's successful add the 'DZNPhotoPickerController' dependancy again in the cocoapods and install that again it may solve your problem
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment