web-dev-qa-db-fra.com

FirebaseApp.configure () a une erreur d'utilisation de l'identificateur non résolu 'FirebaseApp'

Donc, chaque fois dans mon fichier pod, je décide d’ajouter quelque chose comme le pod 'Firebase/Storage ’avec le pod' Firebase/Core’, dans mon application, FirebaseApp.configure() comporte une erreur. L'utilisation de l'identifiant non résolu 'FirebaseApp' est mon fichier pod 

https://docs.google.com/document/d/1U7s5StRuNrI_2WtpHSvHhwhA1TMCsQ255dnjDAEhhcE/edit?usp=sharing

7
Ralph Rodriguez

Votre classe appdelegate devrait ressembler à ceci:

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        FIRApp.configure()
        return true
    }

    func applicationWillResignActive(_ application: UIApplication) {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
    }

    func applicationDidEnterBackground(_ application: UIApplication) {
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    }

    func applicationWillEnterForeground(_ application: UIApplication) {
        // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
    }

    func applicationDidBecomeActive(_ application: UIApplication) {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }

    func applicationWillTerminate(_ application: UIApplication) {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
    }
}

Je suppose que vous utilisez xcode 8 et Swift 3.

10
KingCoder11

Essayez le pod 'Firebase' au lieu du pod 'Firebase/Core'

Et vérifiez si Firebase 4.x a été installé après l'installation de «pod install»

2
Jungyeol

Dans mon cas, c’était parce que j’utilisais une ancienne version de Firebase (3.11.1)

pod repo update
pod update

Après la mise à jour de mon référentiel et de mes référentiels de spécifications locaux avec Firebase (4.2.0), FirebaseApp a été résolu par Xcode!

1
Jorge Casariego

La solution de morganchen12 at this GitHub comment a résolu le même problème pour moi. J'avais besoin de modifier le fichier podfile pour les tests unitaires (OP déjà terminé), puis d'ajouter Firebase aux chemins de recherche d'en-tête.

Pour la conservation, le commentaire est le suivant:

Le problème est dû à des définitions de classe FIRApp en double dans l'exécution du test.

Votre podfile devrait ressembler à ceci:

target "FirebaseDemo" do
  install_pods

  target "FirebaseDemoTests" do
    inherit! :search_paths
  end
end

Afin d'éviter l'erreur de module Firebase requise manquante, ajoutez "$ {PODS_ROOT}/Firebase/Core/Sources" à la fin des chemins de recherche d'en-tête de votre cible de test dans Xcode.

0
Steven B.

Cela résoudra ce problème

 Sudo gem install cocoapods 
 pod update
0
batgun