gpt4 book ai didi

ios - 使用未解析的标识符 'FIRApp'

转载 作者:搜寻专家 更新时间:2023-10-30 22:11:26 27 4
gpt4 key购买 nike

我已经使用 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 一样导入 firebase。

据我所知,您可能会在开发构建上取得成功,因为 FlipperKit 库用于调试,如果满足条件,则使用此#ifdef FB_SONARKIT_ENABLED。当您尝试存档时,它不会被导入并且变量将未声明,因为 #import 仍处于该 if 条件。

关于ios - 使用未解析的标识符 'FIRApp',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38009174/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com