我已经使用 cocoa pod 在我的 iOS 应用程序中实现了 Firebase。问题是当我尝试配置 firebase 时,出现此错误 Use of unresolved identifier '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
最佳答案
我已经尝试了所有的答案,但是在头痛了 2 个小时之后......我找到了这个
在 AppDelegate.m 文件中,您应该在 #ifdef FB_SONARKIT_ENABLED 行之前像 #import
据我所知,您可能会在开发构建上取得成功,因为 FlipperKit 库用于调试,如果满足条件,则使用此#ifdef FB_SONARKIT_ENABLED。当您尝试存档时,它不会被导入并且变量将未声明,因为 #import
关于ios - 使用未解析的标识符 'FIRApp',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38009174/