I am adding cocoa pods to my ios project (swift).
I have initalized the pods in the project directory using 'pod init myproject.xcodeproj'. I then added pod 'Firebase' to the Podfile as such:
project 'HOTS IOS.xcodeproj/'
platform : ios, '9.0'
target 'HOTS IOS' do
use_frameworks!
pod 'Firebase'
target 'HOTS IOSTests' do
inherit! :search_paths
pod 'Firebase'
end
target 'HOTS IOSUITests' do
inherit! :search_paths
pod 'Firebase'
end
end
Now when I run pod install i get the error: Unable to find a specification for 'Firebase'.
Depending on what Firebase service you want to use you have to add different Firebase services in your podfile. "'Firebase'" is not a valid pod.
pod 'Firebase/Core' is the most basic and will give you the prerequisite libraries needed to get Firebase running. If you want to use other services you can choose between these pods:
pod 'Firebase/Core' --> Prerequisite libraries and Analytics
pod 'Firebase/AdMob' --> AdMob
pod 'Firebase/Messaging' --> Cloud Messaging / Notifications
pod 'Firebase/Database' --> Realtime Database
pod 'Firebase/Invites' --> Invites
pod 'Firebase/DynamicLinks' --> Dynamic Links
pod 'Firebase/Crash' --> Crash Reporting
pod 'Firebase/RemoteConfig' --> Remote Config
pod 'Firebase/Auth' --> Authentication
pod 'Firebase/Storage' --> Storage
(Note: without --> text. Only add for example pod 'Firebase/Database')
Here is the documentation for setting up iOS:
https://firebase.google.com/docs/ios/setup
Related
I am refactoring a monolithic codebase and want to split it into frameworks, my current situation is as follows:
App Project, depends on A, B and C
Framework A
Framework B, depends on A
Framework C, depends on A and B
All the above are in the same workspace, and each has his own pods:
App uses Firebase, Cryptoswift and RxSwift
Framework A uses Firebase and RxSwift
Framework B and C use RxSwift
Everything works fine, but at app launch, I see in the log that there are multiple (two) definitions for each framework, for example:
RxSwift is implemented in both 'app' and 'frameworka', which implementation will be used is undefined
(Tried both "Do no Embed" and "Embed & Sign")
Any ideas?
I am also fine switching to some other package manager if it helps solve the problem...
Thanks in advance!
My Podfile looks something like this:
platform :ios, '11.0'
use_frameworks!
workspace 'App'
project 'App/App'
project 'FrameworkA/FrameworkA'
project 'FrameworkB/FrameworkB'
project 'FrameworkC/FrameworkC'
target 'Appp' do
project 'App/App'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
pod 'Firebase/RemoteConfig'
pod 'CryptoSwift'
pod 'RxSwift'
pod 'RxCocoa'
end
target 'FrameworkA' do
project 'FrameworkA/FrameworkA'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Analytics'
pod 'Firebase/RemoteConfig'
pod 'RxSwift'
pod 'RxCocoa'
end
target 'FrameworkB' do
project 'FrameworkB/FrameworkB'
pod 'RxSwift'
pod 'RxCocoa'
end
target 'FrameworkC' do
project 'FrameworkC/FrameworkC'
pod 'RxSwift'
pod 'RxCocoa'
end
After some trial and error I did not find a solution to this.
I just ended up moving to Swift Package Manager, which does throw a compiler error (instead of just a line in the console log) when duplicated dependencies are found.
I then realized I could remove the dependencies and that's it.
I'm new to coding and programming swift
I've tried to install 2 firebase pods FirebaseAuth and FirebaseFirestore with terminal on my current
project but terminal shows me some errors and it won't install pods
errors are :
1-pod install fails with json error on Mac OS X 10.15
2-Invalid Podfile: pod install fails with use_native_modules!
3-pod search
my pod file content is
platform :ios, '13.0'
target 'Flash Chat iOS13' do
use_frameworks!
# Pods for Flash Chat iOS13
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
end
Does anyone know how to fix this problem?
# Add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# Add the pods for any other Firebase products you want to use in your app
# For example, to use Firebase Authentication and Cloud Firestore.
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
# then type the following command
pod install
We are trying to integrate FireBase SDK in Unity Project for iOS platform. For testing, we imported FireBaseAnalytic.unitypackage in an empty project, and put GoogleService-Info.plist on Assets folder.
Once we export XCode project from Unity and build in XCode we are getting few errors about missing few classes from:
we also tried to install Cocoapods file and place Podfile in XCode Project. Cocoapod file contains information as below:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Unity-iPhone' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for Unity-iPhone
target 'Unity-iPhone Tests' do
inherit! :search_paths
# Pods for testing
pod 'Firebase/AdMob'
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Crash'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Invites'
pod 'Firebase/Messaging'
pod 'Firebase/Performance'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
end
end
even these all changes do not help to build test project even just with Firebase Analytic.
I am trying to add FirebaseUI/Storage pod to iOS App which is throwing the following linker error:
framework not found SDWebImage for architecture x86_64
I have tried adding SDWebImage independently and it works but as soon as I add FirebaseUI/Storage pod, it throws the above error.
Any ideas what could be causing this?
This is what my Podfile looks like:
target 'myApp' do
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'FirebaseUI/Storage'
pod 'SDWebImage'
pod 'MMDrawerController'
end
I had this exact same problem. I seem to have fixed it by changing my pod file to...
target 'MyApp' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'SDWebImage', '~>3.8'
# pod 'Firebase/Core'
pod 'FirebaseUI', '~> 1.0'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
end
A few things to note:
I turned on use_frameworks even though I am using Objective C
I turned off my Firebase pod calls - they are pulled in automatically by FirebaseUI
Seems like there is no clear documentation regarding which pods to include to enable just the FirebaseUI/Storage functionality if also including other individual Firebase/... pods.
I needed to remove all pods and install them back without FirebaseUI/Storage since it duped several classes which were not removed once I removed the [FirebaseUI/Storage] pod.
I wonder if anyone of you have tried the database quickstart sample provided by Firebase.
https://github.com/firebase/quickstart-ios/tree/master/database
I am able to run the Objective-C part but when I tried to target the Swift part, there is this error message: Firebase module is not available.
I am not too sure what I did wrong and if you have successfully targeted and ran the Swift part, may be you could give me some hints.
The pod file was included in the sample which is as shown below:
# DatabaseExample
use_frameworks!
platform :ios, '7.0'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'FirebaseUI'
target 'DatabaseExample' do
end
target 'DatabaseExampleSwift' do
end
target 'DatabaseExampleTests' do
end
The pod declarations should be inside your target like so:
platform :ios, '7.0'
target 'DatabaseExample' do
use_frameworks!
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'FirebaseUI'
end
target 'DatabaseExampleSwift' do
end
target 'DatabaseExampleTests' do
end