我正在将Firebase设置为Flutter应用。我完成了Android的设置,并在Firebase Analytics仪表板上看到了流量。但是,iOS版本崩溃并显示以下消息。你能给我任何想法吗?
GoogleService-Info.plist
,并使用mv
命令将其移至ios/Runnder
目录。 pod 'Firebase/Analytics'
添加到ios/Podfile
并运行pod install
。 (这时,我通过Android Studio打开了iOS模拟器,并确认该应用已正常运行。)ios.Runnder.AppDelegate.swift
中添加了两行。import UIKit
import Flutter
import Firebase // Added!!!
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
FirebaseApp.configure() // Added!!!
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 39.5s
path: satisfied (Path is satisfied), interface: en0
*** First throw call stack:
(
0 CoreFoundation 0x000000010cc8527e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x000000010caf2b20 objc_exception_throw + 48
2 CoreFoundation 0x000000010cc850bc +[NSException raise:format:] + 188
3 Runner 0x000000010991c9ea +[FIRApp configure] + 138
4 Runner 0x0000000109917ca4 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 212
5 Runner 0x0000000109917ff4 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 21<…>