2017-03-03 1 views
0

Ich bekomme immer den Fehler Verwendung der nicht aufgelösten Bezeichner 'FIRApp'. Ich habe meinen abgeleiteten Datenordner gelöscht, die Pods aktualisiert und die Pods mehrfach neu installiert. Ich verwende derzeit xcode 8.2.1. Meine pod Versionen sind Mit Firebase (3.14.0) Mit FirebaseAnalytics (3.7.0) Mit FirebaseCore (3.5.1) Mit FirebaseInstanceID (1.0.9) Mit FirebaseMessaging (1.2.2) Mit GoogleToolboxForMac (2.1. 1) Verwenden von Protobuf (3.2.0). Ich benutze die neueste Version von Cocoapoden. Danke für die Hilfe.Fehler: Verwendung der nicht aufgelösten Bezeichner 'FIRApp'

import UIKit 
    import UserNotifications 
    import Firebase 
    import FirebaseInstanceID 
    import FirebaseMessaging 

    @UIApplicationMain 
    class AppDelegate: UIResponder, UIApplicationDelegate { 

     var window: UIWindow? 
     let gcmMessageIDKey = "gcm.message_id" 

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

      // Register for remote notifications. This shows a permission dialog on first run, to 
      // show the dialog at a more appropriate time move this registration accordingly. 
      // [START register_for_notifications] 
      if #available(iOS 10.0, *) { 
       // For iOS 10 display notification (sent via APNS) 
       UNUserNotificationCenter.current().delegate = self 

       let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] 
       UNUserNotificationCenter.current().requestAuthorization(
        options: authOptions, 
        completionHandler: {_, _ in }) 

       // For iOS 10 data message (sent via FCM) 
       FIRMessaging.messaging().remoteMessageDelegate = self 

      } else { 
       let settings: UIUserNotificationSettings = 
        UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil) 
       application.registerUserNotificationSettings(settings) 
      } 

      application.registerForRemoteNotifications() 

      // [END register_for_notifications] 
      FIRApp.configure() 

      // [START add_token_refresh_observer] 
      // Add observer for InstanceID token refresh callback. 
      NotificationCenter.default.addObserver(self, 
                selector: #selector(self.tokenRefreshNotification), 
                name: .firInstanceIDTokenRefresh, 
                object: nil) 
      // [END add_token_refresh_observer] 
      return true 
     } 

Antwort

1

hatte ich das gleiche Problem und löste es die folgenden Schritte in der Befehlszeile tun:

  1. pod Repo-Update
  2. kommentiert die Schote line 'Firebase' von meinem Podfile
  3. pod installieren (dadurch wurde der alte Firebase entfernt)
  4. Die Pod-Firebase-Zeile wurde erneut hinzugefügt.
  5. pod install (hinzugefügt die neue Firebase)
Verwandte Themen