Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
firebase匿名使用Flatter(windows)应用程序登录时出现MissingPluginException异常_Firebase_Flutter_Firebase Authentication_Flutter Desktop - Fatal编程技术网

firebase匿名使用Flatter(windows)应用程序登录时出现MissingPluginException异常

firebase匿名使用Flatter(windows)应用程序登录时出现MissingPluginException异常,firebase,flutter,firebase-authentication,flutter-desktop,Firebase,Flutter,Firebase Authentication,Flutter Desktop,我最近刚开始用颤振换窗户。我正在学习firebase和Flatter教程。在第4课中,我发现Firebase Auth出现错误: Flatter:MissingPluginException(在channel plugins.flatter.io/firebase_auth上找不到方法的实现) 我想问题是因为我在为windows构建。我不知道如何将firebase添加到windows应用程序。谢谢你的帮助 以下是完整的日志: Launching lib\main.dart on Windows

我最近刚开始用颤振换窗户。我正在学习firebase和Flatter教程。在第4课中,我发现Firebase Auth出现错误:

Flatter:MissingPluginException(在channel plugins.flatter.io/firebase_auth上找不到方法的实现)

我想问题是因为我在为windows构建。我不知道如何将firebase添加到windows应用程序。谢谢你的帮助

以下是完整的日志:

Launching lib\main.dart on Windows in debug mode...
Building Windows application...
Waiting for Windows to report its views...
Debug service listening on ws://127.0.0.1:60688/97Ok8iT1Hjo=/ws
Syncing files to device Windows...
flutter: MissingPluginException(No implementation found for method signInAnonymously on channel plugins.flutter.io/firebase_auth)
flutter: error signing in
编辑1

pubspec.yaml文件(依赖项部分)

编辑2

我更新了依赖项以使用以下版本:

  firebase_auth: ^0.18.1+2
  cloud_firestore: ^0.14.1+3
  firebase_core: ^0.5.0+1
但现在我得到了以下错误:

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)
这就是我的主要功能:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(MyApp());
}
但现在我得到了以下错误:

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)
[错误:flatter/lib/ui/ui_dart_state.cc(177)]未处理的异常:缺少PluginException(未找到通道插件上的方法Firebase#initializeCore.flatter.io/Firebase_core的实现)

如中所述,您需要在
android/build.gradle
中的依赖项中设置
com.android.tools.build:gradle:3.5.0

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.0'
    // ...
}

如果您在android上运行应用程序,并且您的
main活动
具有以下导入语句:

import io.flutter.app.FlutterActivity  
您可能需要将其改为:

import io.flutter.embedding.android.FlutterActivity

添加
wait Firebase.initializeApp()后,您只需热重新加载或热重新启动颤振void main()函数中编写>代码

只需停止main.dart进程,从头再运行一次——就这样,现在你的应用程序与firebase集成了

注意:在运行过程中,一些可能会遇到多索引错误问题,请参阅链接:要解决错误,请添加:

在您的项目级别>>android>>应用程序>>build.gradle中:


}

在执行
颤振清理后尝试构建
是否在yaml文件中添加了所需的依赖项?如果您有,是否运行命令
flatter pub get
下载更新的依赖项?@BugsHappen是的,我有。您可以在此处共享您的pubspec.yaml文件,仅依赖项部分吗?@HardikSachan请添加firebase\u核心:^0.5.0+1并重试,但我正在尝试在windows build中使用它。如何初始化firebase for windows build?有一个包fb_auth。你可以查一下。正如他们在软件包信息中所注意到的,它也适用于Windows。firestore是否也有类似的软件包?
defaultConfig {
...

multiDexEnabled true