2017-03-03 5 views
0

未解決の識別子 'FIRApp'の使用中にエラーが発生し続けます。私は派生したデータフォルダを削除し、ポッドを更新し、ポッドを複数回再インストールしました。私は現在xcode 8.2.1を使用しています。私のポッドバージョンは (2.1 GoogleToolboxForMacを使用FirebaseMessaging(1.2.2) を使用FirebaseInstanceID(1.0.9) を使用FirebaseCore(3.5.1) を使用Firebase(3.14.0) 使用FirebaseAnalytics(3.7.0) を使用しています。 1) Protobuf(3.2.0)の使用。私はcocoapodsの最新バージョンを使用しています。助けてくれてありがとう。エラー:未解決の識別子 '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 
     } 

答えて

1

私は同じ問題を持っていたし、それは、コマンドラインで次の手順をやって解く:

  1. ポッドレポ更新
  2. 私Podfile
  3. ポッドからポッド「Firebase」行をコメントインストール(古いFirebaseが削除されました)
  4. ポッドのFirebaseの行が再び追加されました。
  5. ポッドインストール(新しいFirebaseを追加)
関連する問題