0

I'm not sure how, but I managed to install version 1.8.4 of cocoapods. However, I can't update it. I need to update it because the pods for the firebase google sign in require FirebaseAnalytics, and Firebase Analytics requires cocoapods to be 1.10.0. Whenever I try to update it, either by simply sudo gem install cocoapods or sudo gem update cocoapods, I get the following error:

The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first.

This is odd because I do in fact have xcode developer tools installed.

enter image description here

And here are the pods (one of which requires FirebaseAnalytics)

enter image description here

Also see the error message:

enter image description here

This question is similar to several others--I'm asking a new question because the answers to those questions didn't help me and the questions were fairly old, so I doubt I'll get any help there.

I greatly appreciate your help. This problem alone is stopping me from using Firebase's google sign in in my application.

EDIT: After I re-installed cocoapods with brew I checked my pod version, only to find that it was still 1.8.4. I then ran brew upgrade cocoapods and everything seemingly looked up to date. But I checked the version once more and am still seeing 1.8.4. What is going on here?

enter image description here

EDIT 2: bundle result

I was able to successfully (seemingly) install bundle, but I'm getting errors when I try to use bundle to install / update cocoapods.

enter image description here

EDIT 3: Solution Found?

I tried upgrading cocoapods again with brew, and for some reason it worked this time--even though last time I tried upgrading cocoapods with brew it didn't work. (Did bundle help?) I still have yet to see if this solves my original problem, but cocoapods is now version 1.11.2, the newest version. Thanks for all the help!

enter image description here

John Sorensen
  • 710
  • 6
  • 29
  • 1
    FirebaseAuth does not require FirebaseAnalytics. – Paul Beusterien Nov 07 '21 at 05:18
  • You may be right, but certainly one of the pods I need for google sign in with firebase does. See my clarified question. – John Sorensen Nov 07 '21 at 05:51
  • 1
    `Firebase/Core` is deprecated and just a synonym for `Firebase/Analytics` – Paul Beusterien Nov 07 '21 at 15:45
  • If I change `Firebase/Core` to `Firebase/Analytics` will that fix my problem? – John Sorensen Nov 07 '21 at 16:21
  • Nope, the OP said only FirebaseAuth was needed, but if you need Analytics, you need to update CocoaPods. – Paul Beusterien Nov 08 '21 at 03:24
  • If you're not already, use https://bundler.io/ to manage your ruby gems (including cocoapods) and use a `Gemfile` to manage your Cocoapods version. see this post for more: https://stackoverflow.com/a/66395480/1014164 – cohen72 Nov 09 '21 at 06:55
  • See edits to post. Did I use the `Gemfile` incorrectly? I followed the commands in the post you linked. – John Sorensen Nov 10 '21 at 02:31
  • 1
    WIth `brew`, I'd check https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula to install correct version. There is the `brew switch` for instance if you checked correctly the version. Your issue is there I think... Because I think that the 1.11.2_1 is installed, but it's not the one "linked"... See also https://stackoverflow.com/questions/13477363/how-can-i-brew-link-a-specific-version – Larme Nov 14 '21 at 17:13
  • Brew ended up working (at least in updating cocoapods). See my edited post. I have yet to see if this solves my actual problem, but thanks for all the help anyways! – John Sorensen Nov 14 '21 at 21:07

1 Answers1

-2

Updated answer.

  • Install cocapods with brew.

I was facing same issue that installed latest version cocapods with brew but when try to check in terminal my machine always linking old version cocapods so here i bellow commands resolve my issue.

Override brew pods to another pods

brew link --overwrite cocoapods
Vishal Zaveri
  • 1,372
  • 2
  • 5
  • 12
  • I tried that command. Didn’t work. – John Sorensen Nov 07 '21 at 14:59
  • try this https://stackoverflow.com/questions/61496402/cocoapods-stopped-installing-firebase-analytics-with-error – Vishal Zaveri Nov 07 '21 at 15:29
  • For the google sign in, I do believe that I need to use cocoapods--I couldn't find it on SPM and it specifically says to use cocoapods. The stack overflow question you linked to is related to my problem, but didn't address my issue. The answers have to do with the firebase version, but I need to update cocoapods. – John Sorensen Nov 07 '21 at 16:27
  • No the point is that I already tried updating cocoapods--that's exactly the error I'm having. I tried `sudo gem install cocoapods` and `sudo gem update cocoapods` and both gave the error I described above. Is there another way of updating cocoapods that you suggest? – John Sorensen Nov 07 '21 at 17:24
  • Try this : https://stackoverflow.com/questions/64235993/error-installing-cocoapods-macos-bigsur – Vishal Zaveri Nov 07 '21 at 17:40
  • Ok, I used `brew` as suggested in one of the answers to install `cocoapods`. However, it appears that the version is still `1.8.4`. I'm going to try using `brew` to update `cocoapods` next... – John Sorensen Nov 07 '21 at 21:02
  • try this commands this command i was facing same issue - brew link --overwrite cocoapods – Vishal Zaveri Mar 02 '23 at 01:03