Firebase CocoaPods Installation Not Working - ios

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!

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

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

have you tried to add
frameworks
use_frameworks!
after target 'RandomName' line
and adding
platform :ios, '9.0'
before target ....

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

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 :)

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

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

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.

Update Git and Cocoapods to the last version:
Git: $ brew update && brew upgrade
Cocoapods: $ pod repo update

Related

CocoaPods could not find compatible versions for pod "Flipper-Glog": In Podfile:

[!] CocoaPods could not find compatible versions for pod "Flipper-Glog":
In Podfile:
Flipper-Glog (= 0.5.0.4)
None of your spec sources contain a spec satisfying the dependency: Flipper-Glog (= 0.5.0.4).
You have either:
out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
mistyped the name or version.
not added the source repo that hosts the Podspec to your Podfile.
Disable everything related to flipper in Podfile and then cd ios && pod install
# use_flipper!()
Worked after using this command:
pod install --repo-update
If you are building from a fresh Reach Native Project, there should be no need to edit any files in the project to get it to run.
Try the solutions here:
React native ios - error when running pod install (installing Flipper-Glog)
I encountered this problem after deleting all my iOS caches and setting some Virtual Env. Opening Xcode and simulator once then try "pod install" should work.
Remove or comment this line from your ios/Podfile in react native.
# use_flipper!()
For M1 chip Mac, run
"arch -x86_64 pod install"
solved it.

How to check latest version released by facebook for their sdk

I have been using the fb sdk from a while,
i pod file I add
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
and then use pod install
and it automatically install the latest version of pod
But what I'm seeing actually is the installed version is [] is 6.5.11
but the release facebook sdk version is
is not installing a pd without to the specific version mentioned in pod file, installs the latest version automatically ?
if you want to check The Podfile.lock it keeps track of the resolved versions of each Pod installed.
pod update & Pod Install
When you run pod update PODNAME, CocoaPods will try to find an updated version of the pod PODNAME, without taking into account the version listed in Podfile.lock. It will update the pod to the latest version possible (as long as it matches the version restrictions in your Podfile).
If you run pod update with no pod name, CocoaPods will update every pod listed in your Podfile to the latest version possible.
understand the pod install vs. pod update
Use pod install to install new pods in your project. Even if you already have a Podfile and ran pod install before; so even if you are just adding/removing pods to a project already using CocoaPods.
Use pod update [PODNAME] only when you want to update pods to a newer version.
so try with pod update instead of pod install

How to install specific pod file without updating other dependencies?

I am trying to install 2 pod files without affecting/updating other dependencies in my pod file.
I tried with pod install --no-repo-update command. It is not working.
I want to install Fabric pod file when I try to install other dependencies are also updating and I don't want it because some dependencies are deprecated and it will show some warning and error, this is I don't want so I am trying to install pod without affecting and updating other pod files.
Here is the screenshot, in xcode I am getting 197 warnings. Before the installation of pod file there were 6 Xcode warnings.
pod 'Fabric'
pod 'Crashlytics'
You cannot install specific pod but you update specific pod.
Reference
https://guides.cocoapods.org/using/pod-install-vs-update.html
Pod install
Use pod install to install new pods in your project. Even if you already have a Podfile and ran pod install before; so even if you are just adding/removing pods to a project already using CocoaPods.
Pod Update
Use pod update [PODNAME] only when you want to update pods to a newer versio
To install new pod without updating others, just open up the existing file and add your pod file below the existing pods.
Now, go to terminal and open up your project and run command:
$ pod install
Note: This way, it will only add new pod without updating your existing pods.

Alamofire install failed - Xcode 8.1

Recently upgraded to XCode 8.1 trying to install Alamofire pod for a new project. Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'app' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for app
pod 'Alamofire',
:git => 'https://github.com/Alamofire/Alamofire.git',
:branch => 'swift3'
end
And my terminal responds:
image
so what can I do?
--Update--
also tried pod 'Alamofire', '~> 4.0'
here is the result
I did the pod repo update it doesn't do anything at all
Edit your podFile as below and just install the pods using pod install --verbose command if still error exists then update your repo with pod repo update then try again.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'app' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for app
pod 'Alamofire'
end
As per the discussion here,
You need to use
pod 'Alamofire', '~> 4.0'
In your pod file
I faced the same problem when i updated the mac os from el capitan to sierra and installed new version of Xcode.
I updated the cocoapod and still, was facing the same problem.
I found a solution by completely removing cocoapod from root directory and installing it again.
To remove the cocoapod completly use this in terminal
$ sudo rm -fr ~/Library/Caches/CocoaPods/
$ sudo rm -fr ~/.cocoapods/repos/master/
and then install the cocoapod again
$ gem install cocoapods

Warining . Cocoa pods --> Pod install issue

When pod install , get this warning .How to solve the question? Please help me.Thank U very much.
[[!]Your Podfile requires that the plugin cocoapods-no-dev-schemes
be installed. Please install it and try installation again.]
If you have shown your podfile it will more helpful still you can try
sudo gem install cocoapods-no-dev-schemes and after it installs successfully you can try installing the pods again
Or
You can make the podfile structure to default structure in which you don't need any additional plugin like this:
platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
I tried below steps from terminal
$ sudo gem install cocoapods-repo-update
Then fire
$ pod install
This should work now.
Background :
cocoapods-repo-update is a CocoaPods plugin that checks your dependencies when you run pod install and updates the local specs repositories if needed.
As of CocoaPods 1.0, pod install does not update the master specs repo every time it is run. This is because CocoaPods was hammering Github with this behavior. Now the specs repo must be explicitly updated with pod repo update or pod install --repo-update.
This plugin checks if your CocoaPods specs repo needs to be updated when pod install is run and updates it if needed. This eliminates the need to run pod repo update or pod install --repo-update when you change a pod.
Source: https://github.com/wordpress-mobile/cocoapods-repo-update

Resources