iOS – Firebase错误:使用未parsing的标识符FIRApp运行提供的代码
尝试configurationXCode以使用Firebase 3时,使用设置文档中的代码会给我一个错误:
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 }
我认为这是正确的解决scheme:
-
pod repo update
-
pod update
但我有同样的问题,并解决它在命令行上执行以下步骤:
-
pod repo update
- 从我的Podfile评论了
pod 'Firebase'
行 -
pod install
(这删除了旧的Firebase) - 再次添加了
pod 'Firebase'
线。 -
pod install
(添加了新的Firebase)
第二和第三步是我想的关键,否则CocoaPods不会尝试更新它。 正如我所说,也许这可以通过做pod update
解决,但现在我不能回去,再试一次。
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)
我有同样的错误,很容易解决。 closures该项目。 打开pod文件,然后从中更新
pod 'Firebase', '>= 2.5.1'
至
pod 'Firebase/Core' pod 'Firebase/Database'
然后打开位于项目文件夹中的pod文件的terminal,input: pod update
。 确保你看到2行
Installing Firebase 3.2.0 (was 2.5.1) Installing FirebaseDatabase (3.0.1)
那么你很好去
像这样解决这个问题:
import FirebaseAnalytics
那么需要将FIRApp
replace为FirebaseApp
因为FIRApp
已被弃用。
谢谢。
在terminal中更新您的豆荚types
pod update
然后安装吊舱,为我工作
尝试再次使用pod repo update
和pod install
。
我有同样的问题,我解决这个问题。
荚更新…
(仅使用Firebase / Core和Analytics)
我正在使用xCode版本8.2.1希望这将有助于某人。
如果项目比较老,而其他豆荚有问题,则只能更新所需的豆荚: 如何更新单个豆荚而不触及其他依赖关系
首先请确保您的Firebase版本是3,方法是使用控制台input您的项目文件并使用pod更新顺序将您的Firebase版本更新为3
尝试从'pod install'
删除豆荚,然后执行'pod install'
。 添加豆荚,然后做另一个'pod install'
。 清理你的工作空间,然后构build它。 我花了几次尝试,但最终为我工作。
我只是通过将Firebase.configure()更改为FIRApp.configure()
寒意:)
所有其他的答案都是现货,但听起来你已经有了这些东西。 确保您使用的是CocoaPods 1.0(或更高版本)并指定了use_frameworks!
在您的Podfile中。
如果你正在升级,它的价值清除我们的你的豆荚/目录首先可能运行pod deintegrate
到零状态。
事实certificate,hoangpx的答案是解决你的错误的正确方法,改变pod模块的名字帮助。 但是请记住,当您尝试运行pod安装时,会显示(或者应该如果尚未修复):
Note: as of Cocoapods 1.0 'pod repo update' does not happen on 'pod install' by default.
这意味着您应该首先进行pod Firebase update
以更新到版本3.2.0及更高版本的pod install
更新cocoapods到版本1.0.x,然后pod安装解决了我的问题
pod –version(检查您的当前版本)
- 有序arrays与Firebase
- 发布到Clearcut时发生错误:(null),Google Cloud Speech API中的状态码为400
- 如何将Firebase数据caching为离线使用?
- 无法在Xcode中进行debugging:debugging器中将无法使用此模块的debugging信息
- Firebase SDK,离线数据存储,可select在以后同步
- Firebase:FIRApp.configure()一直希望我将其更改为FirebaseApp.configure()
- Firebase:针对同一个项目中的每个应用程序进行自定义validation
- Firebase限制观察员/听众的数量
- 当您将应用服务器从GCM迁移到FCM时,旧客户端会发生什么?