Я пытаюсь запустить приложение Flutter, используя команду flutter clean
, а затем flutter run
на симуляторе iOS (iPhone 8) в первый раз. Я получаю следующую ошибку:
Configuring the default Firebase app...
Configured the default Firebase app __FIRAPP_DEFAULT.
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23e39f0e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50ad79b2 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23e39d4c +[NSException raise:format:] + 188
3 Runner 0x0000000106f1d519 +[FIRApp appWasConfiguredTwice:usingOptions:] + 185
4 Runner 0x0000000106f1cf92 +[FIRApp configureWithName:options:] + 306
5 Runner 0x0000000106f1cd1f +[FIRApp configureWithOptions:] + 143
6 Runner 0x0000000106f1cc6d +[FIRApp configure] + 157
7 Runner 0x0000000106eb81a4 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 212
8 Runner <…>
This is taking longer than expected...
Так что я подозреваю, что ошибка связана с моей зависимостью "Firebase".
1) У меня есть подфайл следующим образом:
pod 'Flutter', :path => 'Flutter'
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
2) Я вижу, что мой GoogleService-Info.plist
живет в / ios / Runner.
3) Мой AppDelegate.swfit
выглядит следующим образом:
import UIKit
import Flutter
import Firebase
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
FirebaseApp.configure()
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Как мне это исправить?