CocoaPods - Explicitly updating a dependency conflict issue - ios

I am facing a scenario where I need AFNetworking 3.0. But signalR has a dependency on AFNetworking 2.0, So it causes a conflict
target “MyTestApp” do
pod 'SignalR-ObjC', '~> 2.0'
pod 'AFNetworking', '~> 3.0'
end
Now when I try an explicitly update (pod 'AFNetworking', '~> 3.0'), then I got error
[!] Unable to satisfy the following requirements:
AFNetworking (~> 3.0) required by Podfile
AFNetworking (~> 2.0) required by SignalR-ObjC/Core (2.0.2)
How should I resolve this conflict?
Another way, if I try to update AFNetworking (included by SignalR)
target “MyTestApp” do
pod 'SignalR-ObjC', '~> 2.0'
end
then
[!] The [AFNetworking] Pod is not installed and cannot be updated
So, how can we update this explicitly?

Related

CocoaPods could not find compatible versions for pod "AFNetworking":

I would like to update my AFNetworking to version pod 'AFNetworking', '~> 4.0', but I am getting the following error.
[!] CocoaPods could not find compatible versions for pod "AFNetworking":
In Podfile:
AFNetworking (~> 4.0)
AFOAuth2Manager was resolved to 2.0.0, which depends on
AFNetworking (~> 2.2)
CocoaPods could not find compatible versions for pod "AFNetworking/NSURLConnection":
In Podfile:
AFOAuth2Manager was resolved to 2.2.0, which depends on
AFNetworking/NSURLConnection (~> 2.2)
None of your spec sources contain a spec satisfying the dependency: `AFNetworking/NSURLConnection (~> 2.2)`.
I am using pod version 1.8.4 and macOS 10.15.3 with xcode11.3.1.
Could you please help me on how to solve the issue
Had a similar problem, changing to
pod 'AFNetworking', '~> 4.0.1'
and removing an outdated dependency
# pod 'AFNetworking+RetryPolicy', '~>1.0.3'
was sufficient to solve this
I have fixed this issue with help from AFNetworking contributor
Please go through the following link
https://github.com/AFNetworking/AFNetworking/issues/4567#event-3368598218
I have updated my podfile like the follwing:
pod 'AFNetworking', :source => 'https://github.com/ElfSundae/CocoaPods-Specs.git'
pod 'AFOAuth2Manager','~> 3.0'

cocoa pods Dependency management

[!] 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
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.
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.
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

Unable to satisfy dependencies required by Mantle and Overcoat in Podfile

I added the following to my Podfile in order to install Mantle and Overcoat
pod 'Mantle', '~> 2.0.5'
pod 'Overcoat', '~> 3.1.1'
and ran pod install. At which point it complained :
AFNetworking/Serialization required by Overcoat/Core (3.1.1)
So I added :
pod 'AFNetworking', '~> 2.6.0'
and ran pod install
At which point it now complains :
AFNetworking (~> 2.6.0) required by Podfile
AFNetworking (= 1.3.4) required by Podfile.lock
How do I resolve these seemingly unresolvable dependencies?

CocoaPods update is downgrading an installed pod

When I run pod update, MMDrawerController is being downgraded from the currently installed version (0.5.7) to an older one (0.4.0).
Here is the contents of my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
link_with 'OpenEye-Mobile', 'SecurityStar Tests'
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.5.0'
pod 'MBProgressHUD', '~> 0.9'
pod 'MMDrawerController'
pod 'MMDrawerController+Storyboard', '~> 0.0.1'
pod 'UIAlertView+Blocks', '~> 0.8.1'
target :"SecurityStar Tests" do
pod 'OCMock', '~> 3.1.1'
end
I just updated the cocoapods gem from v. 0.34.4 to 0.35.0. The only change I have made to the Podfile is updating AFNetworking from 2.3.1 to 2.5.0. If I try to explicitly specify MMDrawerController as v. 0.5.7, I get a dependency error:
- `MMDrawerController (= 0.5.7)` required by `Podfile`
- `MMDrawerController (~> 0.4.0)` required by `MMDrawerController+Storyboard (0.0.1)`
What's going on here? Why is this a problem all of a sudden? Did something change in cocoapods 0.35? Is there a way I can force MMDrawerController+Storyboard to be OK with MMDrawerController (= 0.5.7)?
SOLUTION 1 is specify same range as in MMDrawerController+Storyboard
pod 'MMDrawerController', '~> 0.4.0'
SOLUTION 2 is to update MMDrawerController+Storyboard podspec so that it will use the latest version.
EXPLANATION
The problem is as it says: dependency error.
This line in a podfile means take the latest (for 04.02 is 0.5.7):
pod 'MMDrawerController'
While this one demands 'MMDrawerController+Storyboard' :
pod 'MMDrawerController+Storyboard', '~> 0.0.1'
which, in turn, specifies in it's podspec as a dependency:
s.dependency 'MMDrawerController', '~> 0.4.0'
'~> 0.4.0' means that it can use versions 0.4.0 - 0.4.9 and there is no intersection of 0.5.7 with 0.4.0 - 0.4.9.

how to know which pod spec file your cocoapod install is pointing to

I'm trying to install sharekit via cocoapods. If I search for sharekit on the cocoapod website.. I'm instructed to put this in the podfile:
pod 'ShareKit', '~> 2.5'
the sharekit pod on the website links to this podspec file, which is tagged as 2.5.6.
so far so good.
But when I run the pod install command (I also added platform :ios, '6.0' b/c not doing so will throw compatibility errors) I get this error:
[!] Unable to satisfy the following requirements:
- SSKeychain (~> 0.2.1) required by ShareKit/Core (2.5.6)- SSKeychain (~> 1.2.2) required by Evernote-SDK-iOS (1.3.1)
My question is: why is it telling about what evernote 1.3.1 required? b/c the 2.5.6 podspec has this in it:
s.subspec 'Evernote' do |evernote|
evernote.source_files = 'Classes/ShareKit/Sharers/Services/Evernote/**/*.{h,m}'
evernote.dependency 'Evernote-SDK-iOS', '~> 1.3.0'
evernote.dependency 'ShareKit/Core'
evernote.libraries = 'xml2'
evernote.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
end
so it's clearly linking to evernote 1.3.0
the podspec on sharekit master repo does list evernote 1.3.1 as a dependency.. but what does that gotta do with my pod install request?
to make things even weirder.. it doesn't matter if i put pod 'ShareKit', '~> 2.5.6' or pod 'ShareKit', '~> 2.5.3'.. i still get errors talking about sharekit 2.5.6.. why is that?
The following explains how pod versions are linked into your project (it goes hand in hand with Semantic Versioning.
Besides no version, or a specific one, it is also possible to use logical operators:
'> 0.1' Any version higher than 0.1
'>= 0.1' Version 0.1 and any higher version
'< 0.1' Any version lower than 0.1
'<= 0.1' Version 0.1 and any lower version
In addition to the logic operators CocoaPods has an optimisic operator ~>:
'~> 0.1.2' Version 0.1.2 and the versions up to 0.2, not including 0.2 and higher
'~> 0.1' Version 0.1 and the versions up to 1.0, not including 1.0 and higher
'~> 0' Version 0 and higher, this is basically the same as not having it.
Source: http://guides.cocoapods.org/using/the-podfile.html
If you want to explicitly link to a specific version, then change your podfile to the following:
pod 'ShareKit', '2.5'
I think this will solve the issue temporarily:
# Install 1.3.0 fix pod install error
pod 'Evernote-SDK-iOS', '1.3.0'
pod 'ShareKit', '~> 2.5'

Resources