1

I have imported the Firebase .plist into my project and also all the relevant pods such as: (Firebase, FirebaseDatabase, FirebaseAuth, FirebaseCore, FirebaseInstanceID) but, I'm still getting this error even though my code is similar to the one in Firebase's docs.

enter image description here

What is the problem?

Edit: Actual code:

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        FirebaseApp.configure()

        let myDatabase = Database.database().reference()  <- Error

        return true
    }

Error: Use of unresolved identifier 'Database'

EDIT2: I solved the issue by following these steps here

Abdo23
  • 77
  • 7
  • Instead of adding screenshots of your code, please add the actual code to the question. To capture the error message, right click on the red indicator and "Reveal in Issue Navigator". – Frank van Puffelen May 21 '18 at 21:39
  • Try defining your reference in using `FIRDatabase` like this: `let myDatabase = FIRDatabase.database().reference()` this method has worked for me. – Hayden Crabb May 21 '18 at 21:50
  • @HaydenCrabb That's an older version. You may want to update your pod – Daniel Dramond May 23 '18 at 10:30

0 Answers0