Pregunta

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?

¿Fue útil?

Solución

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'

Otros consejos

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'
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top