Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - Firebase error: Use of unresolved identifier FIRApp running supplied code

Tags:

ios

firebase

When trying to configure XCode to work with Firebase 3, using the code in the setup docs gives me an error:

https://firebase.google.com/docs/ios/setup#add_the_sdk

import UIKit
import Contacts
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    //contacts
    var contactStore = CNContactStore()


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        FIRApp.configure() <-- Use of unresolved identifier 'FIRApp'
        // Override point for customization after application launch.
        return true
    }
like image 246
Allen Su Avatar asked May 19 '16 15:05

Allen Su


2 Answers

I think this is the correct solution:

  1. pod repo update
  2. pod update

But I had the same issue and solved it doing the following steps on the command line:

  1. pod repo update
  2. Commented the pod 'Firebase' line from my Podfile
  3. pod install (this removed the old Firebase)
  4. Added the pod 'Firebase' line again.
  5. pod install (added the new Firebase)

2nd and 3rd steps were the key I think, otherwise CocoaPods didn't try to update it. As I said maybe this could've been solved by doing pod update but now I can't go back and try again.

After all of this you should see something like: Installing Firebase (3.2.0) Installing FirebaseAnalytics (3.2.0) Installing FirebaseInstanceID (1.0.6) Installing GoogleInterchangeUtilities (1.2.1) Installing GoogleSymbolUtilities (1.1.1) Installing GoogleUtilities (1.3.1)

like image 154
Lluis Gerard Avatar answered Nov 15 '22 02:11

Lluis Gerard


I had the same error, resolved easily. Close the project. Open pod file then update from

pod 'Firebase', '>= 2.5.1'

to

pod 'Firebase/Core'
pod 'Firebase/Database'

Then open terminal, located to your pod file in project folder, enter :pod update. Make sure you see 2 lines

Installing Firebase 3.2.0 (was 2.5.1)
Installing FirebaseDatabase (3.0.1)

Then you're good to go

like image 15
hoangpx Avatar answered Nov 15 '22 02:11

hoangpx