Linux 桌面应用程序的 MissingPluginException

MissingPluginException for Linux desktop app

刚刚为我的 flutter 应用程序添加了桌面支持,它在 android 模拟器中运行良好,但不会在浏览器和桌面中呈现任何元素,只是一个没有错误的简单空白页面。

这是我在控制台中遇到的错误,不确定该错误是否真的是问题所在,因为它来自 firebase

Launching lib/main.dart on Linux in debug mode...
Building Linux application...
Debug service listening on ws://127.0.0.1:40449/v58VaNveMLo=/ws
Syncing files to device Linux...
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
<asynchronous suspension>
#1      MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:363:35)
<asynchronous suspension>
#2      MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:31:23)
<asynchronous suspension>
#3      MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:73:7)
<asynchronous suspension>
#4      Firebase.initializeApp (package:firebase_core/src/firebase.dart:42:31)
<asynchronous suspension>
#5      main (package:sqlite_provider_starter/main.dart:9:3)
<asynchronous suspension>

感谢任何帮助!

目前 firebase_core 包在 Android、IOS、MacOS 和 Web 上受支持。 Linux 尚不支持。根据主机平台有条件地执行基于该包的操作的代码部分。