Using Unresolved Identifier 'FIRApp'

I implemented Firebase in my iOS app using cocoa beans. The problem is that when I try to configure FireBase, I get this error. Use of unauthorized identifier "FIRApp" . This error occurs when I use the FIRApp.configure () code in the appdelegate file. Can anyone help me with this?

import UIKit import AWSCore import GoogleMaps import Firebase @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? let defaults = NSUserDefaults.standardUserDefaults() func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. // Use Firebase library to configure APIs FIRApp.configure() return true } } 

I followed the Firebase Guide https://firebase.google.com/docs/ios/setup#initialize_firebase_in_your_app

Here is the pod file

 # Uncomment this line to define a global platform for your project platform :ios, '8.0' use_frameworks! target 'xxxx' do pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git' pod 'DKChainableAnimationKit' pod 'Charts' pod 'JVFloatLabeledTextField' pod 'AWSAutoScaling' pod 'AWSCloudWatch' pod 'AWSCognito' pod 'AWSDynamoDB' pod 'AWSEC2' pod 'AWSElasticLoadBalancing' pod 'AWSKinesis' pod 'AWSMobileAnalytics' pod 'AWSS3' pod 'AWSSES' pod 'AWSSimpleDB' pod 'AWSSNS' pod 'AWSSQS' pod 'GoogleMaps' pod 'Firebase' end 
+6
source share
6 answers

I found out what caused the problem. I used an older version of cocoa pods. When I upgraded the cocoa version to the latest version, the error was fixed. Thanks.

just run it.

 sudo gem update cocoapods 
+2
source

FIRApp is available in Firebase 3.x or later.

This happens when you cannot upgrade older versions of Firebase, say 2.x to 3.x. This has already been answered: Firebase update From 2.5.1 to 3.2.1

and How to upgrade a new Firebase application from an existing old application?

The key is

 pod update 

You need to run pod update once before installing the Firebase module, and it will install the correct version the next time you do it.

+3
source

There is a known issue with importing a Firebase module in Xcode 8. import Firebase may cause a "module not found" error. If so, you will need to import the modules separately until the problem is resolved.

FIRApp is located in the FirebaseAnalytics infrastructure. Add import FirebaseAnalytics to the top of your class file in which you import other modules.

Enable all the frameworks in the Google Analytics folder in the Firebase SDK, currently:

  • Firebaseanalytics
  • FirebaseInstanceID
  • GoogleInterchangeUtilities
  • GoogleSymbolUtilities
  • Google utilities

Make sure you add the -ObjC flag to other_linker_flags in the project settings.

+1
source

My problem was that in my podfile I put the line:

 pod 'Firebase' 

under "MyApplicationUITests" instead of "MyApplication".

and

I did not set

 import Firebase 

at the top of my AppDelegate.

0
source

Took me a little, but I realized that I was using an older version of Xcode (7.3.1) on an older mac.

Initially, using the pod 'Firebase/Core' , Firebase 4.0 is installed. So, I went into the subfile and pointed out version 3.2.1 :

pod 'Firebase/Core', '3.2.1'

And the error immediately disappeared. Hope this saves at least a few hours for someone out there!

0
source

I managed to fix using cocoapods: 1.1.1

 sudo gem install -n /usr/local/bin cocoapods:1.1.1 sudo gem uninstall -n /usr/local/bin cocoapods # uninstall 1.2.0.beta.1 pod --version # 1.1.1 rm -rf platforms plugins cordova platform add ios 
0
source

All Articles