CocoaPods not updating Firebase SDK to Version 4.0.0

22,929

Solution 1

There was nothing wrong with your original Podfile ;) You are just confusing pod install with pod update — you were running the former but you should be using the latter instead. A brief overview to clear things up:

pod install. When you run pod install, it only resolves dependencies for pods that are not already listed in the Podfile.lock. For pods in Podfile.lock, it downloads the explicit version listed there, without checking if a newer version is available — I believe this (expected) behavior was causing your issue.

pod update. If you run pod update, CocoaPods will update every pod listed in your Podfile to the latest version possible. Of course, respecting the version restrictions declared in your Podfile, if any.

For more information, be sure to check the pod install vs. pod update guide as well.

Solution 2

I had a similar issue and was stuck at the following output even after running the run pod repo remove master and pod install and pod update:

Using AmazonAd (2.2.15)
Using Firebase (3.17.0)
Using FirebaseAnalytics (3.9.0)
Using FirebaseCore (3.6.0)
Using FirebaseInstanceID (1.0.10)
Using Google (3.1.0)
Using Google-Mobile-Ads-SDK (7.19.1)
Using GoogleToolboxForMac (2.1.1)

I kept seeing the note in the pod update command output:

[!] Google has been deprecated

So I deleted the Google from the podfile:

 pod Google

Then I re-ran:

 pod update

and Received:

Using AmazonAd (2.2.15)
Installing Firebase 4.3.0 (was 3.17.0)
Installing FirebaseAnalytics 4.0.4 (was 3.9.0)
Installing FirebaseCore 4.0.8 (was 3.6.0)
Installing FirebaseInstanceID 2.0.4 (was 1.0.10)
Installing Google-Mobile-Ads-SDK 7.24.1 (was 7.19.1)
Using GoogleToolboxForMac (2.1.1)
Installing nanopb (0.3.8)

Solution 3

I had the same problem and just fixed it by changing the pod subsec into the full name of the pods like this:

-    pod 'Firebase/Core'
-    pod 'Firebase/RemoteConfig'
+    pod 'FirebaseCore', '4.0.9'
+    pod 'FirebaseRemoteConfig', '2.0.3'

Rather weird that this confusion happened in the first place but at least this fixes it.

Solution 4

Similarly to how Alamofire in my original podfile states the version I would like, doing so for firebase made it update to version 4.0.0 and the appropriate firebase functions work now.

For example:

Change (for each):

pod 'Firebase/Auth'

To:

pod 'Firebase/Auth', '~> 4.0.0'

A full example of my new podfile and the output after running pod install is as follows.

Correct Podfile:

# Uncomment this line to define a global platform for your project
platform :ios, '9.2'
# Uncomment this line if you're using Swift
use_frameworks!


target 'myProject' do

pod 'Firebase', '~> 4.0.0'
pod 'Firebase/Auth', '~> 4.0.0'
pod 'Firebase/Core', '~> 4.0.0'
pod 'Firebase/Storage', '~> 4.0.0'
pod 'Firebase/Database', '~> 4.0.0'
pod 'Firebase/Crash', '~> 4.0.0'
pod 'Firebase/Messaging', '~> 4.0.0'


pod 'Alamofire', '~> 4.4'

end

Output

Analyzing dependencies
Downloading dependencies
Using Alamofire (4.4.0)
Using Firebase (4.0.0)
Using FirebaseAnalytics (4.0.0)
Using FirebaseAuth (4.0.0)
Using FirebaseCore (4.0.0)
Using FirebaseCrash (2.0.0)
Using FirebaseDatabase (4.0.0)
Using FirebaseInstanceID (2.0.0)
Using FirebaseMessaging (2.0.0)
Using FirebaseStorage (2.0.0)
Using GTMSessionFetcher (1.1.10)
Using GoogleToolboxForMac (2.1.1)
Using Protobuf (3.3.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 8 dependencies from the Podfile and 13 total pods installed
Share:
22,929
Rbar
Author by

Rbar

Hi there. I'm a lifelong learner, nerd, and curious person with a passion for learning and sharing knowledge with others. I hope I can help you out and vice versa.

Updated on September 10, 2020

Comments

  • Rbar
    Rbar almost 4 years

    I am trying to update my Swift project to Firebase's new SDK Version 4.0.0 using CocoaPods (as suggested by the documentation) but the updated SDK does not seem to be installing even when I follow the steps in the documentation.

    Can anyone help my understand why this is not working and what I can do to update to the new Firebase SDK?

    My Podfile

    # Uncomment this line to define a global platform for your project
    platform :ios, '9.2'
    # Uncomment this line if you're using Swift
    use_frameworks!
    
    
    target 'myProject' do
    
    pod 'Firebase'
    pod 'Firebase/Auth'
    pod 'Firebase/Core'
    pod 'Firebase/Storage'
    pod 'Firebase/Database'
    pod 'Firebase/Crash'
    pod 'Firebase/Messaging'
    
    
    pod 'Alamofire', '~> 4.4'
    
    end
    

    When I run pod install I get this seemingly promising output (except that it is not version 4 as I think it should be):

    Analyzing dependencies
    Downloading dependencies
    Using Alamofire (4.4.0)
    Installing Firebase 3.17.0 (was 3.17.0)
    Using FirebaseAnalytics (3.9.0)
    Using FirebaseAuth (3.1.1)
    Using FirebaseCore (3.6.0)
    Using FirebaseCrash (1.1.6)
    Using FirebaseDatabase (3.1.2)
    Using FirebaseInstanceID (1.0.10)
    Using FirebaseMessaging (1.2.3)
    Using FirebaseStorage (1.1.0)
    Using GTMSessionFetcher (1.1.9)
    Using GoogleToolboxForMac (2.1.1)
    Using Protobuf (3.3.0)
    Generating Pods project
    Integrating client project
    Sending stats
    Pod installation complete! There are 8 dependencies from the Podfile and 13 total pods installed.
    

    I can tell it isn't updating to the most recent SDK as well because the new firebase documentation does not match the functions that work in my project. My project is in Swift, so for example:

    Works

    FIRApp.configure()
    

    Does not work (but is suggested by documentation)

    FirebaseApp.configure()
    

    I did try these solutions as well: