[英]Firebase has not been correctly initialized and the "GoogleService-Info.plist" file in the required folder
我的应用程序在 Android 上正常运行,但在 iOS 上有异常。
iOS 构建是在 Codemagic 上完成的。
开发。 环境 - Windows Flutter Dart。
有什么不见了?
mainCommon 中以下行的异常
FirebaseApp firebaseApp = await Firebase.initializeApp();
mainCommon -
Future<void> mainCommon() async {
try {
loggerDBND("START - MainComminStart0");
FirebaseApp firebaseApp = await Firebase.initializeApp();
loggerDBND("START - MainComminStart1");
FirebaseMessaging.onBackgroundMessage(_messageHandler0);
loggerDBND("START - MainComminStart2");
globals.messaging = await FirebaseMessaging.instance;
loggerDBND("START - MainComminStart3");
globals.messaging.requestPermission();
loggerDBND("START - MainComminStart4");
await globals.messaging.subscribeToTopic("messaging");
loggerDBND("START - MainComminStart5");
globals.messaging.getToken().then((value) {
print("Token -" + value.toString() + "-");
});
loggerDBND("START - MainComminStart6");
} on Exception catch (exception) {
loggerDBN("mainCommon - exception"+exception.toString() );
} catch (error) {
loggerDBN("mainCommon - error" + error.toString());
}
例外——
main- error[core/not-initialized] Firebase has not been correctly initialized. Have you added the "GoogleService-Info.plist" file to the project?
View the iOS Installation documentation for more information: https://firebase.flutter.dev/docs/installation/ios
文件“GoogleService-Info.plist”位置- ....\\ios\\Runner
在过去的类似问题中,通过使用 Apple 的 Xcode 拖放文件将GoogleService-Info.plist
添加到正确的文件夹是解决方案。
另一个用户提供了 Windows解决方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.