Firebase not downloading pods - xcode

When I install 'Firebase' pod, this message comes out and I am not able to work on Xcode.
Lopez-MacBook-Pro:tres Lopezeselmejor$ vim Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'tres' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for tres
'Firebase'
end
Lopez-MacBook-Pro:tres Lopezeselmejor$ pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `tres.xcworkspace` for this project from now on.
Pod installation complete! There are 0 dependencies from the Podfile and 0 total
pods installed.
[!] The Podfile does not contain any dependencies.

Change your Podfile to :-
use_frameworks!
target 'tres' do
pod 'Firebase'
end
When your terminal is done installing Firebase to your app. Close your current .xcodeProj go to your app folder, you will see a .xcworkspace file, Open that and do your further coding in there..
PS:- In swift3 , you might run into some problems in tests file.. see this :- No such a module 'Firebase' in Tests.swift file

Related

after pod installing , Xcode build is not working

my Podfile is
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment the next line if you don't want to use dynamic frameworks
# use_frameworks!
# Pods for MyApp
pod 'TensorFlowLiteObjC'
end
right after install pod file by commanding
arch -x86_64 pod install
then build keep failed saying
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I did many things that on web says...delete pods file...clean .... I did almost everything but no worth it.
it just happened when install pod.
m1 Mac

How to fix "The target [...] is declared multiple times" after pod install?

Working on a react-native(version 0.59.5) project, just installed cocoapods(version 1.7.5)
Installation process:
(from within project directory)
-sudo gem install cocoapods
(from within iOS directory of project)
-pod init
-pod install --repo-update
Result:
Analyzing Dependencies
[!] The Target 'ProjectName-tvOSTests' is declared multiple times.
then tried pod update which resulted in the same 'Analyzing Dependencies' warning. There is only a Podfile and a 'Pods' directory in iOS directory. the pods directory has three sub-directories which are all empty. It seems there was a hangup during pod install but I don't know where to look for the duplicate declaration.
I'm aware you should be working from within the ProjectName.xcworkspace file after a installing cocoapods, but there is no .xcworkspace file in my iOS directory of project. How do I fix this?
EDIT:
Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'TicTacWHOA' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for TicTacWHOA
pod 'Google-Mobile-Ads-SDK'
target 'TicTacWHOA-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'TicTacWHOATests' do
inherit! :search_paths
# Pods for testing
pod 'Google-Mobile-Ads-SDK'
end
end
target 'TicTacWHOA-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for TicTacWHOA-tvOS
target 'TicTacWHOA-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
The issue was that the "Target" was literally declared twice in the Podfile. so simple and right in front of your face potentially. I Just didn't think anything of it because it was a completely generated file except the one line I added.
All you need to do is go to podfile and look for the code in the error
for example my error was
[!] The target fifty-tvOSTests is declared multiple times.
now i have deleted this piece of code from the podfile once.
target 'fifty-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
fifty is the name of my project you know well what is yours
the above piece of code was twice in the Podfile so delete if you find multiple just keep only once

no such module 'Alamofire' but in Podfile

I have adopted a Swift project from about 6 months ago and am getting the error:
It's probably not an Alamofire issue as changing the order with SwiftlyJSON causes me to get a No such module 'SwiftlyJSON' error.
I have Product -> Clean'd it and rebuilt but nothing seems to work. Here's a copy of the Podfile.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "9.3"
use_frameworks!
target 'TatterTwo' do
# pod 'pop', '~> 1.0'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'KeychainAccess'
pod 'Alamofire'
pod 'MBProgressHUD'
pod 'SwiftyJSON','3.0.0'
# pod 'Timberjack', '~> 0.0'
end
I am sure I am using the .xcworkspace rather than .xcodeproj
Ok, there might be different reasons behind this error
First, try to stop the build and start again. If this doesn't work then
Open your Podfile, that is supposed to be located inside of the project folder. Podfile configuration. Make sure your target matches the project name. If you did any modification then go to terminal locate the project folder and run sudo pod update, it should give you an output "Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed". After this restart your xcode file. Oh yeah and the last make sure you are opening .xcworkspace instead of xcodeproj
Reinstall Alamofire manually, and restart Xcode.
Make sure you check "No" on the project file for ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
It took ages for me to get it to work.

"No such module 'Firebase'" when add Firebase into a library

I just created new Framework and added Firebase via CocoaPods, when combine the library it success.
But when I add that library to other project via CocoaPods as well, then combine that project, and it raise an error: No such module 'Firebase'
Anyone faced a problem like this?
You need to add the follwing to your POD file:
pod 'Firebase'
After that, you need to type in your terminal
pod install (to refresh the pod file)
I solve my problem using just the specific import that I'm using, for example.
In my SDK I'm using FirebaseCore and FirebaseAnalytics.
Into my class I just import:
import FirebaseCore
import FirebaseAnalytics
And in my .podspec I needed to set static_framework property to true, so my .podspec it's seems like code below:
s.static_framework = true
s.dependency 'Firebase'
s.dependency 'Firebase/Core'
It works for me!
Do you open the workspace file after installed with cocoa pods ?
Check if the library is added in "Linked Frameworks" or "Embedded Binaries"
If it didn't work, add this pod file
platform :ios, '8.0' use_frameworks! target ‘Your Project’ do
pod 'Firebase', '>= 2.5.1'
pod ‘Firebase/Auth’
pod ‘Google/SignIn’
pod ‘Firebase/Database’
pod 'Firebase/Storage' end
and then type pod deintegrate and after that run pod install.
tried all these..
I was stuck in this situation for more than 2weeks.
finally resolved by adding "excluded architectures = arm64"
this is the easiest solution nowadays
Everything was setup fine and was working before but..
My Problem:
What's was wrong with me?
I was using older name of pod, eg. - pod 'Firebase/Analytics', pod 'Firebase/Crashlytics'
New pod names are pod 'FirebaseAnalytics', pod 'FirebaseCrashlytics' (Problem with / )
Solution:
Use new pod name to integrate pod 'FirebaseAnalytics', pod 'FirebaseCrashlytics' (Install pod with new pod name)
Import import FirebaseCore, import FirebaseAnalytics instead just import Firebase
import FirebaseAnalytics - I'm using for log events
Hi today i fix same problem
1 : open podfile from xcode than add " pod 'Firebase' "
save and close it
2 : open vscode or any editor using, open new terminal than write " cd ios " to open ios file than " pod install " when you install it showing problem need to add search path
so now open ios file from xcode and go to : runner > target runner > build settings > all > search paths
and add this " $(inherited) " into framework search path and header search path
that's all
For me I had to change the version specified in the Podfile as it was above what my app supported. Specifically in the Podfile I changed: 'platform :ios, '11.0' to platform :ios, '10.0' which corresponds with Deployment Info in the General Tab for my app I'm working on.
For Flutter folks adding Firebase to their apps, make sure you follow the steps in Add Firebase to your iOS Project as well as those in the SDK setup steps in the Firebase Console:
In summary:
Run pod init if you don't have a pod file
Add the necessary pods to the bottom of the podfile. All possible Firebase pods can be found here.
pod 'Firebase/Analytics'
pod 'Firebase/Firestore'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
Run pod install
This issue can be caused by incorrectly set-up schemes:
If you have multiple schemes (e.g. 'Dev', 'QA', 'Production' etc.) in your project, check you have the build configurations set correctly.
Further guidance in this answer here:
https://stackoverflow.com/a/65453578/12322900
Then run pod deintegrate and pod install and make sure you're using the .xcworkspace file.
My failure was that I downloaded modules to
target 'YourProjectUITests' do
# Pods for testing
pod 'FirebaseCore'
And the right one is
# Pods for YourProject
pod 'FirebaseCore'
(Without UITests)
It is because you don't have added pod dependency in Podfile.
you will find below line in Podfile
Uncomment this line to define a global platform for your project
#platform :ios, '9.0'
follow the below steps.
1)just remove the # .so it will be like.
platform :ios, '9.0'
2)add the below dependencies.(Do not add all ,you just need to add whatever used in you app ,if you have used Firebase/Core only then add that line only)
#Pods for app name
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
3)clean the build
flutter clean
4)run Command :
flutter run (It will automatically adds a required pods).
that's it.
The same thing happened to me last week. I solved it by:
1. pod deintegrate
2. Open Xcode and delete any instance of pod.
3. pod install

Xcode can't find a module, after updating

I've recently updated my Xcode, but I faced with strange issue.
I'm installing library via cocoapods and use it further in my project, but after updating I Xcode can't find the module, I've installed via CocoaPods
I've updating pods, but the problem stays.
Also I have Pods.framework red
What is the problem?
Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'Bloom' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Bloom
target 'BloomTests' do
inherit! :search_paths
# Pods for testing
end
target 'BloomUITests' do
inherit! :search_paths
# Pods for testing
end
end
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Gifu'
UPD: Solved it by opening the project with the .xcworkspace file not with .xcodeproj.
Do the following things and you can import any swift file from "Pods"
Clean your project
Make sure that all your "Pods" > "Build Settings" > "Build Active Architecture Only" is set to "NO".
Don't run, just build your project.
Now, import any file from "Pods" to any swift file
This will solve your import module problem.
Update:
To solve this issue delete the current pod file and create one using the terminal. Follow the below steps:
1) Open Terminal.
2) Navigate to your Project Path.
3) Type pod init in terminal to create new pod file.
4) Open the newly created pod file and write the pod line which you want to install after target "TargetName" do and before end.
5) Then type pod install in the terminal.
Hope this helps!
I had to delete my podfile and ALL the files it made including the .workspace file then I did:
pod init
open -a Xcode Podfile
add pods I want to podfile then save and close xcode.
Finally do pod install and open the new workspace file :)
change your pod file like this and clean the project quit xcode and reopen it.it may solve the problem
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Comment this line if you're not using Swift and don't want to use
dynamic frameworks
use_frameworks!
target 'Bloom' do
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Gifu'
end
target 'BloomTests' do
inherit! :search_paths
# Pods for testing
end
target 'BloomUITests' do
inherit! :search_paths
# Pods for testing
end
Some frameworks in cocoapods declare a hard-link to XCode in the module description file (XMPP for example). So, be sure that you have:
place XCode.app in /Application (default folder), with name
"XCode.app", not Xcode-beta.app
or/and
call xcode-select to specify the right XCode.app:
sudo xcode-select --switch /Applications/Xcode.app
I had the same issue after I tried to merge a branch using Xcode (never again!).
What finally worked for me was:
Deleting derved data
Cleaning project
Exiting Xcode
Running 'pod install' again in my project

Resources