Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CocoaPods not updating Firebase SDK to Version 4.0.0

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:

  • https://stackoverflow.com/a/38135857/4206520
  • https://stackoverflow.com/a/37365721/4206520
like image 917
Rbar Avatar asked May 29 '17 15:05

Rbar


3 Answers

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.

like image 135
Paulo Mattos Avatar answered Nov 13 '22 06:11

Paulo Mattos


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)
like image 40
Jacksonsox Avatar answered Nov 13 '22 06:11

Jacksonsox


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.

like image 4
Alper Avatar answered Nov 13 '22 05:11

Alper