Firebase CocoaPods Installation Not Working

后端 未结 9 2094
再見小時候
再見小時候 2020-12-08 16:09

I\'m trying to install Firebase via CocoaPods for my Objective-C iOS Application. My Podfile is as follows:

target \'RandomName\' do

pod \'Firebase/Core\'
po         


        
相关标签:
9条回答
  • 2020-12-08 16:24

    I am having the same problem. Check what version of Firebase is installed when you use pod 'Firebase'. For me it installs 2.4.3 which is an old version. The docs say that the pod should install 3.2. using that pod. It explains why the other pods don't work as they are part of Firebase 3. Pod update doesn't update Firebase to the latest version either. Even forcing a version doesn't work. It can't seem to find the new Firebase versions even though they are in the same podspec.

    Here is how I solved it:

    • make sure you have the latest version of git installed
    • make sure you have cocoapods >= 1.0.0 installed
    • delete your pods repo (run pod repo remove master) and use pod setup to make a new one
    • use the following in your pod file

      pod 'Firebase/Auth'

      pod 'Firebase/Database'

      pod 'Firebase/Core'

    (use whatever you want, just don't use 'Firebase')

    • pod install
    • everything should install properly
    0 讨论(0)
  • 2020-12-08 16:26

    A couple of items to try. From your question, you did try the first two items, but leaving here for completeness of my answer.

    • The error response you get is helpful. Follow the steps for pod repo update

    • Make sure your pod is up to date.

      pwd> pod --version
      1.0.0
      
    • Make certain that your git is up to date. I had a build machine that had an outdated git (1.7), and I had the same exact error

    • -

    When I updated to this version from git 1.7 it worked fine.

    pwd> git --version
    git version 2.8.1
    
    • My Podfile for using Firebase Dynamic Links
    • run pod init from the folder where your .xcodeproj is
    • Be sure to only launch the .xcworkspace instead of the .xcodeproj from here out.
    platform :ios, '8.0'
    use_frameworks!
    
    target 'the-name-of-target' do
     pod 'Firebase/DynamicLinks'
    end
    
    0 讨论(0)
  • 2020-12-08 16:29

    Running 'pod repo remove master' to remove the Pods repo //removes the library

    Running 'pod setup' //clones the updated git repo for specs which takes long time as its size is beyond 300K (Be patient!)

    Running 'pod install' //problem is solved

    0 讨论(0)
  • 2020-12-08 16:30

    have you tried to add

    frameworks use_frameworks!

    after target 'RandomName' line

    and adding

    platform :ios, '9.0'

    before target ....

    0 讨论(0)
  • 2020-12-08 16:33

    I just doing following step to fix this error:

    $pod setup -- verbose
    

    Then do $pod install

    that works for me and my pod file is:

    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '8.0'
    use_frameworks!
    
    target 'the-name-of-target' do
     pod 'Eureka', '~> 1.6'
    end
    

    UPDATE:

    Then you can remove your master and re-install cocoapods using following code:

    cd ~/.cocoapods/repos
    rm -rf master
    pod setup
    
    0 讨论(0)
  • 2020-12-08 16:33

    For people still having problems with this. When directly coping the firebase walkthourgh website, the install string is:

    pod `Firebase/Core`
    

    While it should have been:

    pod 'Firebase/Core'
    

    No need for pod setup if this applies to you too.

    0 讨论(0)
提交回复
热议问题