Search code examples
macoscocoapodspodfile

Cocoapods cannot install pod


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


Solution

  • 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.