iOS - Firebase错误:使用未解析的标识符FIRApp运行提供的代码 [英] iOS - Firebase error: Use of unresolved identifier FIRApp running supplied code
问题描述
当尝试配置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
-
pod repo update
-
pod更新
问题并解决它在命令行上执行以下步骤:
$ b $ ol $ b $ li $ $ c $ pod repo update
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:
pod repo update
pod update
But I had the same issue and solved it doing the following steps on the command line:
pod repo update
- Commented the
pod 'Firebase'
line from my Podfile pod install
(this removed the old Firebase)- Added the
pod 'Firebase'
line again. 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屋!