我想将Firebase添加到我的flutter应用程序中。当我之前开发另一个flutter应用程序时,当时我也使用了Firebase,这很好。但是,这一次它不能很好地工作。我认为这是因为最近的抖动将IOS部分从object-c更改为swift。
下面是我的AppDelegate.m
文件。
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
@import Firebase;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
[FIRApp configure];
// Override point for customization after application launch.
//return [super application:application didFinishLaunchingWithOptions:launchOptions];
return YES;
}
@end
我收到此错误消息。
path: satisfied (Path is satisfied), interface: en0
6.3.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
6.3.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
6.3.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23b98a1c +[NSException raise:format:] + 188
3 Runner 0x000000010e2f5feb +[FIRApp configure] + 555
4 Runner 0x000000010e2f5738 -[AppDelegate application:didFinishLaunchingWithOptions:] + 120
5 UIKitCore 0x00007fff4715994f -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 232
6 UIKitCore 0x00007fff4715b2e7 -[UIApplication _callInitializationDe<…>
还有pubspec.yaml
。
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
firebase_core: ^0.2.5 # add dependency for Firebase Core
我该如何解决这个问题??? ?
答案 0 :(得分:0)
您的应用程序是否有Firebase项目?您需要从Firebase控制台下载GoogleService-Info.plist,并将其添加到XCode工作区。