14

I am making a React-Native mobile application and want to incorporate Firebase and Firebase Authentication. However, I am facing this error when I run 'pod install' or 'pod update':

enter image description here

I did some research and found out that this issue has not yet been resolved by Google (https://issuetracker.google.com/issues/254418199), but I came across a workaround (https://github.com/firebase/firebase-ios-sdk/issues/10359) which said to add a version specifier to the Podfile: pod 'FirebaseAuth', '>= 9.6.0'. However, even after I added the line into the Podfile in my iOS folder, the same error still persists. May I know if I'm doing something wrongly?

7 Answers 7

32

I stumbled upon the same issue. It seems it's a compatibility issue with the latest Firesbase SDK version (10).

For now something that worked for me is to place this at the top of the Podfile:

$FirebaseSDKVersion = '9.6.0' (Docs)

This overrides the default firebase sdk and assures it uses the downgraded version.

Now just execute pod install and give a try. If it doesn't work try removing the Podfile.lock and the Pods folder and try again.

BTW I didn't need this line in the Podfile as one of the resources you shared mentioned:

pod 'FirebaseAuth', '>= 9.6.0'

5
  • 1
    Thank you, it works! :) But now my build fails when I run on the iOS simulator: The following build commands failed:CompileC Library/Developer/Xcode/DerivedData/Chatbot-eeojnmlkiuetmccwazfgajbalxbi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFBFirestore.build/Objects-normal/arm64/RNFBFirestoreCollectionModule.o /Users/xxx/Chatbot/node_modules/@react-native-firebase/firestore/ios/RNFBFirestore/RNFBFirestoreCollectionModule.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNFBFirestore' from project 'Pods') (1 failure) Any tips? Commented Nov 4, 2022 at 8:15
  • I also got a similar error (although I'm not quite sure if it's the same). I solved it following this answer: stackoverflow.com/a/62981498/5627152 Surprisingly uninstalling all my firebase dependencies and then installing them again worked like a charm. Give a try! I hope this also works for you. Commented Nov 4, 2022 at 15:35
  • I am currently using "@react-native-firebase/app": "17.0.0", for this also should i add $FirebaseSDKVersion = '9.6.0' in pod file ? what does this mean actually ?
    – Sadanand
    Commented Feb 10, 2023 at 4:10
  • 2
    @Sadanand "@react-native-firebase/app": "17.0.0" is what you have in your package.json. That's your npm package version. Behind the scenes a native package is installed which is FirebaseSDK (and the version differs from the the one in npm). The thing is that if you don't specify a version in your podfile then it will install the latest version (10.X.X) which is the one that has the compatibility issues. In order for you to avoid those compatiblity issues you need to specify $FirebaseSDKVersion = '9.6.0' in the podfile which is a version that doesn't have this issue. Commented Feb 14, 2023 at 1:38
  • Worked like a charm with $FirebaseSDKVersion = '9.6.0'. Using "@react-native-firebase/auth": "^17.3.1" and "@react-native-google-signin/google-signin": "^9.0.2" in package.json. I also tried using $FirebaseSDKVersion = '10.5.0' but did not work.
    – NoNam4
    Commented Feb 24, 2023 at 18:56
6

try to delete Podfile.lock and run cd ios && pod install --repo-update

1

What helped me is to add this into my pod file.

pod 'GTMSessionFetcher', :modular_headers => true

and then run

arch -x86_64 pod update GTMSessionFetcher/Core
1

I am using the Unity game engine and had encountered the same issue with my iOS build. However, I managed to solve it by identifying a common dependency version of GTMSessionFetcher/Core. Initially, I had to downgrade to Firebase 9.6.0 because there was no common dependency with Firebase version 10 and GoogleSignIn 4.0.2.

Here's the revised pod file:

source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'

target 'UnityFramework' do
  pod 'Firebase/Auth', '9.6.0'
  pod 'Firebase/Core', '9.6.0'
  pod 'Firebase/Firestore', '9.6.0'
  pod 'Firebase/Functions', '9.6.0'
  pod 'Firebase/Messaging', '9.6.0'
  pod 'FirebaseInstallations'
  pod 'GoogleSignIn', '4.0.2'
  pod 'GTMSessionFetcher/Core', '1.7'
end
target 'Unity-iPhone' do
end
use_frameworks! :linkage => :static

The critical line in this pod file is:

pod 'GTMSessionFetcher/Core', '1.7'

I've chosen the exact common version for all of them. I hope this helps.

0

For me helped defining a specific version for GTMSessionFetcher, for example:

pod 'GTMSessionFetcher', '~> 2.1'

Check the message error for the requirements in your case, is asking for:

GTMSessionFetcher (~> 1.1) and GTMSessionFetcher (~> 2.1) 

And probably in the Podfile.lock latest version breaks one of this requirements, so specifying an exact version in the Podfile that complies with the requirements, will do the trick.

0

I got a similar error during pod installation on a Flutter app, what worked for me was:

  • updating all the mentioned dependencies to the latest stable versions (in the pubspec.yaml file).
  • running pod install again.
-1
 pod update GTMSessionFetcher/Core

Running pod update updates all pods in your project to the latest versions that are compatible with the version constraints specified in your Podfile. This can sometimes resolve compatibility issues and update dependencies to versions that work better together.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.