Firebase pod installation error - ios

I am really stuck at this step of Firebase Installation to my iOS app.Firebase installation to Xcode I tried many times and finally I could install some 'pod files' to my project. But when i add import Firebase, error shown like
No such module 'Firebase'
Can anyone tell me how to install firebase pod into my existing ios project ? Also how to clear the pod I just installed to it.
I am using swift 2.2, Scode 7.3 and mac os x ei
my pod content is
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target ‘APPNAME’ do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for APPNAME
target 'APPNAME Tests' do
inherit! :search_paths
# Pods for testing
end
target 'APPNAME UITests' do
inherit! :search_paths
# Pods for testing
end
end
My Error :
image of my error

Add This Line in your pod file
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target ‘APPNAME’ do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Firebase', '>= 2.5.1'
# Pods for APPNAME
target 'APPNAME Tests' do
inherit! :search_paths
# Pods for testing
end
target 'APPNAME UITests' do
inherit! :search_paths
# Pods for testing
end
end
and after that update pod

Related

Install pods for Today Extension(Widget) in iOS

How can I install pods for an extension also named as Widget in my app. I'm already having that pod installed for my app target.
I've looked online and the solution that I found has got me errors like one in the screenshot.
Following is the code in my pods file:
platform :ios, '9.0'
use_frameworks!
target 'myapp' do
pod 'Alamofire', '~> 4.8.0'
end
target 'myapp_extension' do
pod 'Alamofire', '~> 4.8.0'
end
Multiple commands produce '/Users/abc/Library/Developer/Xcode/DerivedData/myapp-hitzznvtnviylfcammkfaxjvlryg/Build/Products/Debug-iphonesimulator/myapp.app/Frameworks/nanopb.framework':
1) That command depends on command in Target 'myapp' (project 'myapp'): script phase “[CP] Embed Pods Frameworks”
2) That command depends on command in Target 'myapp' (project 'myapp'): script phase “[CP] Embed Pods Frameworks”
You can use inherit! :search_paths to add same pods to your extensions
platform: ios, '9.0'
target 'myapp' do
use_frameworks!
pod 'Alamofire', '~> 4.8.0'
target 'myapp_extension' do
inherit! :search_paths
end
end

How to define pod file for iOS Extension

When defining my Podfile as below, and then building my app with my extension I get a build error in the DKImagePickerController framework with an error similar to this: Error "'sharedApplication' is unavailable: not available on iOS (App Extension)...." when compiling after pod update
As you can see I have not included the DKImagePickerController framework in my extension target in my Podfile, so I'm wondering what I am doing wrong?
platform :ios, '10.0'
def base_pods
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'DKImagePickerController', '~> 3.4.0'
...
pod 'SAMKeychain'
end
target 'MyApp' do
use_frameworks!
base_pods
target 'MyAppExtension' do
pod 'Firebase/Auth'
pod 'SAMKeychain'
end
target 'MyAppUnitTests' do
inherit! :search_paths
pod 'Firebase'
pod 'FirebaseAuth'
pod 'FirebaseUI/Auth'
end
end
Update
I appreciate that I am getting the error due to an API being unavailable, what I am trying to figure out is how to avoid it. My suspicion is on my podfile, hence my question :)
I had the same issue, so for anyone else finding this thread, I was able to solve the problem by creating two top-level targets instead of using a nested target.
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Eureka', '~> 3.0'
pod 'ChameleonFramework', '~> 2.0'
pod 'SharedPod', '~>1.0'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
end
target 'MyApp Today' do
use_frameworks!
# inherit! :none
# Pods for MyApp Today
pod 'SharedPod', '~>1.0'
end
To get a clean start I then ran...
pod deintegrate
-- Then cleaned out the project file in XCode
pod install
There are few API's which are unavailable in App Extension's. One of them is UIApplication. The framework developer has to make sure this never happens. https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW6

Unable to install Firebase into my Xcode project via cocoapods

I am trying to import Firebase into my Xcode file via Cocoapods 1.1.1. My pod file looks something like this.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Firebase Login' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Firebase Login
pod 'Firebase', '~> 3.11'
target 'Firebase LoginTests' do
inherit! :search_paths
pod 'Firebase'
end
target 'Firebase LoginUITests' do
inherit! :search_paths
# Pods for testing
end
end
I also tried this.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Firebase Login' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Firebase Login
target 'Firebase LoginTests' do
inherit! :search_paths
pod 'Firebase'
end
target 'Firebase LoginUITests' do
inherit! :search_paths
# Pods for testing
end
end
Afterwards, I typed pod install in my terminal and this is what I got.
Analyzing dependencies
[!] Unable to find a specification for `FirebaseAnalytics (= 3.6.0)` depended upon by `Firebase/Core`
Is this something I have done wrong or is it a bug with Firebase itself? If it's me, I would appreciate it if someone can help me solve this problem.
You should add those pods before target 'Firebase LoginTests' do
Otherwise you will only include them your test target.
your podfiel should look like this
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'AppName' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for AppName
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
target 'AppName' do
inherit! :search_paths
# Pods for testing
end
target 'AppName' do
inherit! :search_paths
# Pods for testing
end
end

no such module 'Firebase' in Xcode (Swift)

I have been looking up on every website that had a similar/identical issue to this Xcode error and I have tried everything and nothing has worked. Most people say cleaning and building the project will make Firebase recognized but that hasn't worked. I've tried a bunch of different framework search paths but each framework is in a different folder, not one framework folder. This is my podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'Target' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Target
target 'TargetTests' do
inherit! :search_paths
pod 'Firebase', '>= 2.5.0'
# Pods for testing
end
end
these are my project folders
i've tried making my framework search path $(SRCROOT) and all variations and nothing works. My issue seems to be unlike any other that I can find from googling. I suspect its the framework search path but i don't know what to make it, and I could be wrong.
Any help would be greatly appreciated.
# 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!
# Pods for Promposal
target 'Promposal' do
pod 'Firebase', '>= 2.5.0'
# Pods for testing
target 'PromposalTests' do
inherit! :search_paths
pod 'Firebase', '>= 2.5.0'
end
end
You were writing your podfile properly and you were adding the Firebase only to the test. Try this podfile and check.
It was good for me:
platform :ios, '10.0'
use_frameworks!
def shared_pods
pod 'Firebase'
end
target 'TargetName' do
shared_pods
end
target 'TargetNameDev' do
shared_pods
end

No such module 'Alamofire' in XCode 7.3 & Swift 2.2

I am integrating Almofire via cocoapods in my new swift project. After successful installation of Alamofire pod, i am unable to import it in my swift file. Xcode shows following error.
No such module 'Alamofire'
Following is my Podfile for reference
source 'https://github.com/CocoaPods/Specs.git'
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'CoreDataSample' do
pod 'Alamofire', '~> '3.4'
end
target 'CoreDataSampleUITests' do
end
I have already referred following issues in Almofire on github
Issue #551
Issue #1130
Also tried following things
Project clean
Project Build
Removed Derived Data
Any advise would be appreciate.
Try this inside your pod file
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
target 'demoAlamofire' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for demoAlamofire
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire'
target 'demoAlamofireTests' do
inherit! :search_paths
# Pods for testing
end
target 'demoAlamofireUITests' do
inherit! :search_paths
# Pods for testing
end
end
I hope this will help you.

Resources