21

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'
pod 'Firebase/AdMob'

end

When I run pod install, I get the following error:

[!] Unable to satisfy the following requirements:

- `Firebase/Core` required by `Podfile`

None of your spec sources contain a spec satisfying the dependency: `Firebase/Core`.

You have either:
 * out-of-date source repos which you can update with `pod repo update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

The latest version of CocoaPods is installed, and I have tried running pod repo update. Having a Podfile of the following works fine, but when I try to @import Firebase; in my AppDelegate.m file, Xcode cannot find the module.

target 'RandomName' do

pod 'Firebase'

end

However, the following combination does not install:

target 'RandomName' do

pod 'Firebase'
pod 'Firebase/AdMob'

end

Any help would be appreciated!

Alex Wulff
  • 2,039
  • 3
  • 18
  • 29
  • While using pod 'Firebase' in podfile & after importing Firebase as @import Firebase; do you build the project? If no then try building it. Because Xcode complains about not finding the module but upon building the error goes away. When I was integrating some other framework I faced similar issue & spent hours on it. But after building it started working. So maybe same case might be with you. – Osama Mohammed Shaikh May 27 '16 at 14:37

9 Answers9

30

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
General Grievance
  • 4,555
  • 31
  • 31
  • 45
Matt
  • 688
  • 5
  • 15
  • 5
    Ahh finally! Running 'pod repo remove master' to remove the Pods repo and then running 'pod setup' and finally 'pod install' did the trick!!! I did not need to downgrade to 1.0.0 however. Thanks for your help! – Alex Wulff Jul 03 '16 at 02:21
  • THANK YOU!!!! THANK YOU!!!! THANK YOU!!!! This worked! 'pod repo remove master' to remove the Pods repo and then running 'pod setup' and finally 'pod install' did the trick!!! – KamyFC Oct 05 '16 at 10:05
  • Thanks a lot. `pod repo remove master` and then `pod setup` did the trick. – fs_tigre Oct 15 '17 at 16:02
13

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

Aadi007
  • 247
  • 2
  • 5
  • Even though it took a lot of time for pod setup this solved the issue for me. Thanks. – Jageet Mohan J Jul 22 '16 at 13:11
  • 'pod repo remove master' to remove the Pods repo and then running 'pod setup' and finally 'pod install' did the trick!!! – KamyFC Oct 05 '16 at 10:05
  • Excellent - took about 15 minutes for me and immediately solved my - `Firebase/Core` required by `Podfile` None of your spec sources contain a spec satisfying the dependency: `Firebase/Core`. error even though I had up to date git and pod versions. – Jazzmine May 14 '17 at 22:22
1

have you tried to add

frameworks use_frameworks!

after target 'RandomName' line

and adding

platform :ios, '9.0'

before target ....

kemalony
  • 195
  • 1
  • 7
  • I have the following Podfile according to your changes, but it did not work: source 'https://github.com/CocoaPods/Specs.git' platform :ios, '9.0' target 'RandomName' do use_frameworks! pod 'Firebase/Core' pod 'Firebase/AdMob' end – Alex Wulff May 27 '16 at 19:57
1

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
RobLabs
  • 2,257
  • 2
  • 18
  • 20
  • I updated Git to version 2.8.2 and already had Cocoapods version 1.0.0, but still no luck. Running pod repo update was also not successful. – Alex Wulff May 27 '16 at 19:57
  • Updated answer with my Podfile. The call to `use_frameworks!` is outside of the target/end structure – RobLabs May 27 '16 at 20:33
  • That's strange - still cocoapods will install just Firebase fine, but the second I try and add something after it like in your Podfile it does not work. The Podfile you provided (after I replaced the target name) still does not install correctly. – Alex Wulff May 29 '16 at 01:07
  • Sorry to hear the all the issues. I struggled as well. I added two other items in my edited answer (`pod init` & .xcworkspace). – RobLabs May 29 '16 at 16:21
  • Still nothing, sorry. I'm not using Swift, so should I leave use_frameworks! commented? – Alex Wulff May 30 '16 at 16:22
  • I would leave use_frameworks! commented This is what a fresh Podfile for Objective C looks like # platform :ios, '9.0' target 'firebase-demo' do # Uncomment this line if you're using Swift or would like to use dynamic frameworks # use_frameworks! # Pods for firebase-demo end – RobLabs May 30 '16 at 20:29
1

The Same problem occurred while on pod install command.

Please relaunch terminal and navigate to your Xcode project then

simply fire same pod install command. 'Firebase/Database' will installed successfully :)

Harshal Wani
  • 2,249
  • 2
  • 26
  • 41
0

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
Nitin Gohel
  • 49,482
  • 17
  • 105
  • 144
  • Still no luck. Running pod setup --verbose gives me the following warning: 'CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose'. Running pod repo update --verbose gives me the same warning again. – Alex Wulff Jun 08 '16 at 21:40
  • And when I try to install I get the same error I've been having – Alex Wulff Jun 08 '16 at 21:40
0

I had the same error, and my solution was to downgrade Cocoapods to 1.0.0, because Cocoapods 1.0.1 didn't work as I expected. Everything works great now!

  • sudo gem uninstall cocoapods -v 1.0.1

  • sudo gem install cocoapods -v 1.0.0

My Podfile:

platform :ios, '8.0'

target 'XXX' do

  pod 'Firebase/Auth'
  pod 'Firebase/Database'

end
Victor
  • 914
  • 12
  • 15
0

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.

Magnus Wang
  • 170
  • 1
  • 2
  • 6
0

Update Git and Cocoapods to the last version:

Git: $ brew update && brew upgrade

Cocoapods: $ pod repo update