iOS - Firebase错误:使用未解析的标识符FIRApp运行提供的代码 [英] iOS - Firebase error: Use of unresolved identifier FIRApp running supplied code

查看:309
本文介绍了iOS - Firebase错误:使用未解析的标识符FIRApp运行提供的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试配置XCode以与Firebase 3一起使用时,使用设置文档中的代码会给我一个错误:

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

 导入UIKit 
导入联系人
导入Firebase
$ b @UIApplicationMain $ b $ class AppDelegate:UIResponder,UIApplicationDelegate {

var window:UIWindow?

//联系人
var contactStore = CNContactStore()


func应用程序(application:UIApplication,didFinishLaunchingWithOptions launchOptions:[NSObject:AnyObject]?) - > Bool {
FIRApp.configure()< - 使用未解析的标识符'FIRApp'
//覆盖点在应用程序启动后自定义。
return true


$ div class =h2_lin>解决方案

我认为这是正确的解决方案:
$ b


  1. pod repo update

  2. pod更新

问题并解决它在命令行上执行以下步骤:
$ b $ ol $ b $ li $ $ c $ pod repo update

  • 从我的Podfile评论 pod'Firebase'

  • pod install (这个删除了旧的Firebase)
  • 再次添加了 pod'Firebase'

  • pod install (添加了新的Firebase)



    <第二步和第三步是我想的关键,否则CocoaPods不会尝试更新它。正如我所说,也许这可以通过做 pod更新来解决,但现在我不能回去,再试一次。



    安装Firebase(3.2.0)
    安装FirebaseAnalytics(3.2.0)
    安装Firebase(3.2.0)
    安装FirebaseAnalytics(3.2.0)后,您应该看到如下所示的内容:
    安装FireWireInstanceID(1.0.6)
    安装GoogleInterchangeUtilities(1.2.1)
    安装GoogleSymbolUtilities(1.1.1)
    安装GoogleUtilities(1.3.1)


    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
        }
    

    解决方案

    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)

    这篇关于iOS - Firebase错误:使用未解析的标识符FIRApp运行提供的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆