簡體   English   中英

缺少插件異常(在通道插件上找不到方法 firebase#initializecore 的實現。flutter.io/firebase_core)

[英]missingpluginexception(no implementation found for method firebase#initializecore on channel plugins.flutter.io/firebase_core)

錯誤描述我正在 windows 桌面上運行我的 flutter 應用程序 我在 android 工作室中使用主通道以便在桌面上運行它。 I have integrated firebase to my app, and login signup is working fine, but when I try to add or get data from my cloud firestore, the error appears to be is " No Firebase App '[DEFAULT]' has been created - call Firebase Flutter 和 Firebase 中的 .initializeApp(),通過添加解決

void main()
async
{
   WidgetsFlutterBinding.ensureInitialized();
   await Firebase.initializeApp();
   // if (USE_FIRESTORE_EMULATOR) {
   //   FirebaseFirestore.instance.settings = Settings(
   //       host: 'localhost:8080', sslEnabled: false, persistenceEnabled: false);
   // }
  runApp(MyApp());
}

到我的應用程序。 但添加后我得到了這個錯誤:

Launching lib\main.dart on Windows in debug mode...
Building Windows application...
Debug service listening on ws://127.0.0.1:14281/b7FohxM2yN4=/ws
Syncing files to device Windows...
[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] 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:156:7)
<asynchronous suspension>
#1      MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:344:35)
<asynchronous suspension>
#2      MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:30:22)
<asynchronous suspension>
#3      MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:75:7)
<asynchronous suspension>
#4      Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:9)
<asynchronous suspension>
#5      main (package:res_ds/main.dart:17:4)
<asynchronous suspension>

這就是我無法解決的錯誤。 出現此錯誤后,我的應用程序 GUI 未顯示。 我嘗試了多種互聯網上可用的解決方案,但沒有一個對我有用。 我在下面提供了 flutter 醫生和 pubspec,請查看並幫助我解決此問題。 在此先感謝Flutter 博士

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.27.0-2.0.pre.67, on Microsoft Windows [Version 10.0.19041.804], locale 
en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.4)
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.52.1)
[√] Connected device (1 available)

! Doctor found issues in 1 category.

Pubspec.yaml

name: res_ds
description: A new Flutter application.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

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: ^1.0.2
  provider: ^4.3.2+2
  http: ^0.12.2
  cloud_firestore: ^0.14.2
  firebase_core: ^0.5.0
  image_picker: ^0.6.7+22


dev_dependencies:
  flutter_test:
    sdk: flutter
  integration_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
     - assets/images/
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

Flutter Firebase 插件目前不支持 Windows ,這就是為什么在 ZAEA063489CE3AAAB46 上運行時沒有插件實現的原因

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

相關問題 MissingPluginException(MissingPluginException(在通道 plugins.flutter.io/firebase_core 上找不到方法 Firebase#initializeCore 的實現) MissingPluginException(在 Android 上找不到方法 Firebase#initializeCore 在通道插件上的實現。flutter.io/firebase_core) 未處理的異常 MissingPluginException:在通道 plugins.flutter.io/firebase_core 上找不到方法 Firebase#initializeCore 的實現 MissingPluginException(在通道插件上找不到方法 Firebase#initializeCore 的實現。flutter.io/firebase_core)發布模式 未處理的異常:MissingPluginException(在通道插件上找不到方法 X 的實現。flutter.io/Y) MissingPluginException(在通道 plugins.flutter.io/path_provider 上找不到方法 getApplicationDocumentsDirectory 的實現) MissingPluginException(未在通道插件上找到方法 init 的實現。flutter.io/google_sign_in) MissingPluginException(MissingPluginException(未找到方法 camera#animate on channel plugins.flutter.io/google_maps_53)的實現) Flutter Unhandled Exception: MissingPluginException(No implementation found for method pickImage on channel plugins.flutter.io/image_picker) 錯誤 FLUTTER 未處理的異常:MissingPluginException(在通道插件上找不到方法 map#waitForMap 的實現。flutter.io/google_maps_0)
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM