我已经使用可可豆荚在我的iOS应用程序中实现了Firebase.问题是当我尝试配置firebase时,我收到此错误使用未解析的标识符’FIRApp’.当我在appdelegate文件中使用代码FIRApp.configure()时,会发生此错误.谁能帮我这个?
import UIKit import AWscore import GoogleMaps import Firebase @UIApplicationMain class AppDelegate: UIResponder,UIApplicationDelegate { var window: UIWindow? let defaults = NSUserDefaults.standardUserDefaults() func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. // Use Firebase library to configure APIs FIRApp.configure() return true } }
我遵循了Firebase指南https://firebase.google.com/docs/ios/setup#initialize_firebase_in_your_app
这是pod文件
# Uncomment this line to define a global platform for your project platform :ios,'8.0' use_frameworks! target 'xxxx' do pod 'SwiftyJSON',:git => 'https://github.com/SwiftyJSON/SwiftyJSON.git' pod 'DKChainableAnimationKit' pod 'Charts' pod 'JVFloatLabeledTextField' pod 'AWSAutoScaling' pod 'AWSCloudWatch' pod 'AWSCognito' pod 'AWSDynamoDB' pod 'AWSEC2' pod 'AWSElasticLoadBalancing' pod 'AWSKinesis' pod 'AWSMobileAnalytics' pod 'AWSS3' pod 'AWSSES' pod 'AWSSimpleDB' pod 'AWSSNS' pod 'AWSSQS' pod 'GoogleMaps' pod 'Firebase' end
解决方法
FIRApp可在Firebase 3.x或更高版本中使用.
如果您无法从旧版本的Firebase更新2.x到3.x,则会发生这种情况.这已在这里得到解答 –
Firebase Upgrading From 2.5.1 to 3.2.1
和
How to upgrade new Firebase app from exist old app?
关键是 –
pod update
您需要在安装Firebase pod之前运行一次pod更新,并在下次执行时安装正确的版本.