- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
错误描述
我在 Windows 桌面上运行我的 flutter 应用程序
我在 android studio 中使用主 channel 以便在桌面上运行它。
我已将 firebase 集成到我的应用程序中,并且登录注册工作正常,但是当我尝试从我的云 firestore 添加或获取数据时,错误似乎是“没有创建 Firebase 应用程序'[DEFAULT]' - 调用 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 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.
发布规范.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 插件 do not currently support Windows ,这就是为什么在 Windows 上运行时没有插件实现的原因。
关于android - 缺少插件异常(在 channel plugins.flutter.io/firebase_core 上找不到方法 firebase#initializecore 的实现),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66259416/
例如,我有一个父类Author: class Author { String name static hasMany = [ fiction: Book,
代码如下: dojo.query(subNav.navClass).forEach(function(node, index, arr){ if(dojo.style(node, 'd
我有一个带有 Id 和姓名的学生表和一个带有 Id 和 friend Id 的 Friends 表。我想加入这两个表并找到学生的 friend 。 例如,Ashley 的 friend 是 Saman
我通过互联网浏览,但仍未找到问题的答案。应该很容易: class Parent { String name Child child } 当我有一个 child 对象时,如何获得它的 paren
我正在尝试创建一个以 Firebase 作为我的后端的社交应用。现在我正面临如何(在哪里?)找到 friend 功能的问题。 我有每个用户的邮件地址。 我可以访问用户的电话也预订。 在传统的后端中,我
我主要想澄清以下几点: 1。有人告诉我,在 iOS 5 及以下版本中,如果您使用 Game Center 设置多人游戏,则“查找 Facebook 好友”(如与好友争夺战)的功能不是内置的,因此您需要
关于redis docker镜像ENTRYPOINT脚本 docker-entrypoint.sh : #!/bin/sh set -e # first arg is `-f` or `--some-
我是一名优秀的程序员,十分优秀!