Flutter Firebase Auth 包出现“错误:找不到成员”

Ama*_*dar 15 firebase firebase-authentication flutter google-cloud-firestore

 /Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-6.2.0/lib/src/method_channel/utils/exception.dart:14:11: Error: Member not found: 'Error.throwWithStackTrace'.\n Error.throwWithStackTrace(exception, stackTrace);\n       ^^^^^^^^^^^^^^^^^^^\n/Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-6.2.0/lib/src/method_channel/utils/exception.dart:17:9: Error: Member not found: 'Error.throwWithStackTrace'.\nError.throwWithStackTrace(\n     ^^^^^^^^^^^^^^^^^^^\n/D:/Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-6.2.0/lib/src/method_channel/utils/exception.dart:12:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.\n\nNever convertPlatformException(Object exception, StackTrace stackTrace) {\n   ^\nFAILURE: Build failed with an exception.\n
Run Code Online (Sandbox Code Playgroud)\n

我的 pubsec.yaml 只有:

\n
    \n
  • 云火存储:
  • \n
  • firebase_核心:
  • \n
  • uuid:
  • \n
  • firebase_auth:^3.3.8
  • \n
  • 提供者:^6.0.2
  • \n
\n

导入 firebase 包后出现此错误。

\n
Doctor summary (to see all details, run flutter doctor -v):\n[\xe2\x88\x9a] Flutter (Channel master, 2.6.0-12.0.pre.657, on Microsoft Windows [Version 10.0.19044.1526], locale en-IN)\n[\xe2\x88\x9a] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)\n[\xe2\x88\x9a] Chrome - develop for the web\n[\xe2\x88\x9a] Android Studio (version 2020.3)\n[\xe2\x88\x9a] Android Studio (version 2021.1)\n[\xe2\x88\x9a] Connected device (3 available)\n\n\xe2\x80\xa2 No issues found!\n
Run Code Online (Sandbox Code Playgroud)\n

Sha*_*que 6

为我。升级flutter解决了这个问题。 flutter upgrade


Ama*_*dar 4

我尝试使用最新版本,但没有成功。较低的版本 firebase_auth: 2.0.0对我有用。