0

I ran pod install after I updated my Podfile, the LeanCloud pod was not installed, and I got the following message:

Analyzing dependencies [!] There are only pre-release versions available satisfying the following requirements:

'LeanCloud', '>= 0'

You should explicitly specify the version in order to install a pre-release version

Here is how my Podfile looks like:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'todolist' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for todolist
 pod 'Alamofire'
 pod 'SwiftyJSON'
 pod 'LeanCloud', '>= 0'
end

I'm running on macOS 10.12.3, with Cocoapods Version 1.2.0

rmaddy
  • 314,917
  • 42
  • 532
  • 579
f_qi
  • 689
  • 8
  • 21

3 Answers3

1

You have to specify which version of a dependency you’d like to use. Take a look here how versioning works:

  1. == 1.0 means “Use exactly version 1.0”
  2. >= 1.0 means “Use version 1.0 or higher”
  3. ~> 1.0 means “Use any version that’s compatible with 1.0″, essentially meaning any version up until the next major release. That is:
    • If you specify ~> 1.7.5, then any version from 1.7.5 up to, but not including 2.0, is considered compatible.
    • Likewise, if you specify ~> 2.0 then Cocoapods will use a version 2.0 or later, but less than 3.0.
    • Compatibility is based on Semantic Versioning

From here, you have to choose which LeanCloud version you want to use. Then change it accordingly in your pod file based on those steps above.

nayem
  • 7,285
  • 1
  • 33
  • 51
  • You tried with `pod 'LeanCloud', '>= 0'`, right? Now can you try with `pod 'LeanCloud', '>= 10.0'`?? – nayem Mar 22 '17 at 03:53
0

I am not very good in English I think you did not specify a mobile version

platform :ios, '9.0' <-You should try to open this sentence

刘明鑫
  • 111
  • 1
  • 4
-1

Somehow I got it to work by move the line pod LeanCloud to be the first pod, and ran pod update.

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'todolist' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for todolist
 pod 'LeanCloud'
 pod 'Alamofire'
 pod 'SwiftyJSON' 
end

⇒ pod update
Update all pods
Updating local specs repositories

CocoaPods 1.2.1.beta.1 is available. To update use: sudo gem install cocoapods --pre
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.1.beta.1

Analyzing dependencies
Downloading dependencies
Installing Alamofire 4.2.0 (was 4.4.0)
Installing LeanCloud (10.0.0)
Using SwiftyJSON (3.1.4)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 3 total pods installed.

f_qi
  • 689
  • 8
  • 21
  • This has nothing to do with the order of the pods you specify. It's currently working because you haven't specify the **version** of the pod. So the most recent version will be used. – nayem Mar 22 '17 at 04:19
  • Initially I tried with no version specify, but it gave me the same message, as me to specify a version, then I tried your #2. Same message. That's why I post this question on SO. – f_qi Mar 22 '17 at 12:55